fix cppcheck warnings.