Exporting at the end of a file causes race conditions.