Correctly handle newline on mac and windows.