Fix bug where bad carriage returns mess up line endings.