better handling for windows line endings (fixes #1)