Modify for more precise newline detection.