Ignore trailing spaces and comments in the selectors groups. Fixes #1134