Apply some corrections from CSV.toArray() to CSV.toJSON()