Fix a few cppcheck warnings