Fixes a problem with out of order tree preload nodes

Fixes #817