Tidy up python a bit.