New function to clean up trailing whitespace.