Some tidying up in the conversion script