I believe my fix (#6) is more correct.

The core issue is that a call to connect() doesn't result in both nodes being counted, if the destination node is a leaf node.