Misc python tidying