Various file upload/import fixes