Remove trailing space when saving file