Bug fixes in CreateExportFile