Fixed a bug in the csv export