There might be some weird delay with UninviteUnit on nonexistent members, causing something to happen after the loop. Normally, unit functions on nonexistent units are silently ignored.
In any of the versions, find this:
replace with this:
Code:
if UnitExists(u..i) and not
I also thought about an edge case where the loop may miss someone because unit IDs in a group could get shuffled around.
In any of the versions, find this:
replace with this: