Miscellaneous cppcheck fixes.