Tidy up some minor mistakes, make sure the output is in utf-8