Tidy up various minor things that appear lots of times throughout the codebase.