Various fixes to the import script.