Fix a bug in CSV export