A small tidy up of various parts of the code.