Pathfinding bugfix