fix some cppcheck warnings (cf. issue 2373)