csv tests and bugfix