fix some indent and an off-by-one bug
escaping commas in csv