Remove trailing spaces, end files with newlines