Fix nasty parsing bug that didn't deal with line endings right