Remove trailing whitespaces from user inputs