Fixed other bugs in the export functions