Fix some issues with exporting