fix various problems with the data parsing thing