Fixes to csv import/export