Add tests for autodetectCsvType (and fix bug)