I don't think that $chan is filled in the onQUIT event, since quits are not specific to any single channel.

-genius_at_work