Fix crash in IRC hook