Fixed "on despawn" error when removing an NPC.