Csv fixes

cc @mwiebe

Merging once tests pass to test against jenkins/windows