Small bugfix on pathfinding.