Trim out double and end-of-string spaces