Fix a few cppcheck findings

Aha!