[fix bug 818005] Multiple fixes to CSV export functionality