Some minor fixes and tidying.