Fix CRLF issue.

Fix CRLF issue and add limited logging to detect other problems that could be silently ignored.