Fix handling of new lines on Windows