Fix _getGroup calculation