Tidy up the code for cppcheck style.