Widget: Avoid adding extra spaces to the result of this._classes(...)

This is a PR on top of a PR (#1369).
garbage in = garbage out