Fixed a bug caused by phantom crashing on certain events.