Fixes file writing issue.
Adds new line at the end of each line.