Fixed handling of deleting groups