Removing newlines at the end of the files