CSV export bug fixes