Bugfix in exporting data