Only make newlines if source did

Thanks to @einfallstoll for the original code
Fixes #21