Fixes tree depth counter function

- Tree depth counter function now runs on non-leaf nodes. Children are
checked if a non-leaf node.
- Leaf nodes are now included in the statistics to improve spacing.