Convert newlines to UNIX-style

Fixes #586