Fixed bug in CSV output row count