Fix for the recursive contruction of the tree.
Merge pull request #38 from patrickdmccarthy/treeFix

Fix for the recursive construction of the tree.