Fix various bugs where pathfinding isn't actually executed.

The old code would cancel pathfinding if it thought the parameters were
unchanged. The new code actually checks if the parameters match or not.