Fixed a bug when there is a newline at end of csv.