Revamped CSV export (fixed #137)