Fix waiting for import/export jobs to finish