fix some cppcheck warnings