parseCSV bug fix and some cleanup