Improved library pathfinding.