Fixed a deadend behavior bug