fix a few cppcheck warnings