Various tidying

Can rebase into one commit if you like.