More intelligent treatment of bootstrap nodes.
Fixes distance ordering logic.