Fix a kind of bad bug in the pathfinder (which meant it favoured longer connections)