Some fixups in refine.cc

Most fixup where directly or indirectly triggered by Cppcheck

Merge request reports

Loading