Fix for pathfinding bug.