fix cppcheck errors
Merge pull request #464 from koeppea/fix-cppcheck-errors

fix cppcheck errors