GC,
if you put
MyGroup=group this
in the init line of any(!) of the group members you WILL HAVE a group name.
So the command
leader MyGroup
provides you with the leader each time u ask for it.
If all group members are dead, " count units MyGroup = 0 ",
MyGroup is still a valid variable name and, yes, the 'leader' command might deliver some "isNull error" ... BUT don't forget... OFP can take a minute(s !) to update the group array data after the last team member dies...
ww