Fix bugs with csv parse