Fix a bug in checking whether the group of a link is one of the current groups