Clean up diagnostics reported by cppcheck.