Preserve newlines at the end of files if they exist

Fix for Issue #8