More bugfixes. We need to look at the csv generation