fix cppcheck warnings

Address #35