Test and minor refactor findCloseNodes.