cppcheck: fix some issues