Corrected bad written line count for csv writer