Fix some problems exporting empty datasets