fixed cppcheck warnings