Fixed csv generation
Merge branch 'fix/to_csv' into develop