Fix logic around incorrect tree comparison.

Right now, the hashtree is not computed as documented, which under the
default settings produces a tree such as the following:

1: [0]
2: [0]
3: [0...1023] (each of which, is a orddict of 1024 keys)

Adjust this code to reflect the current structure.