fix cppcheck warnings