Additional note, using $remove($nick(#,$nick).pnick,$nick) will return all of $nick's active modes.