Removing erroneous whitespace, adding trailing newlines to files