Fix newline detection for unix systems