Fixes #5631 Return a unique list of hosts when joining groups