BUG: correcting bugs in export_csv