Added missing newlines at end of files and returned errors if any