Fixes tree node counter child function

- Prototype of _childTreeNodeCounter has been corrected.
- Inequality in function has been corrected to also consider indices
with zero.
Adds node counter function calls to main

- Node counter initialisation and populate function calls have been
added to the main function.