cppcheck warnings cleaning up