Issue [#2675484] by BryanDeNijs: Fixed line endings are sometimes not exploded correctly. Code cleanup.