Trim unnecessary spaces.