GroupsCommand: make the way comps are searched more robust. (RhBug:1051869)

Also fixes some related problems introduced with the recent GroupCommand
changes.