Fixed cppcheck warnings.