Handle line endings a bit more gracefully