Some mods to the csv code