Fix build and improve csv test generation