Fix endpointGroups to properly group endpoints