Fixed CSV logging