[#1038] Fix top level groups including deleted ones.