Newline detection fix