Fix issue #2133 with \r\r\n line endings being generated.