Bugfix for creating csv files