the documentation for "on QUIT" needs some additional words to the effect:
$chan is $null when processing this event, although the applicable nickname is supplied by $nick. More than one channel may be affected by the client quit from a server. The number of affected channels is $comchan($nick,0). The channel names are $comchan($nick,N).

similarly, the documentation for "on DISCONNECT" needs a few more words:
$chan is $null when processing this event. More than one channel may be affected by a server disconnect. The number of affected channels is $comchan($me,0). The channel names are $comchan($me,N).

p.s.: what's this I see about an "undocumented ME level" in event processing? How about at least a documentary mention in the ChangeLog?