Better cppcheck fixes