Fix of bug in tree depth reporting found by Nidhi

Tree depth was increased even though no new tree leaves were generated.