Misc tidy-ups

Hi Eric,

This contains a number of minor tweaks, some of them to move towards being "CPANTS clean".

Cheers,
Neil