Issue #647, fix newline handling edge case.