Checking for valid subgroups