Remove trailing spaces on write and tab settings