Patch for ArrayIndexOutofBoundsExc.

Handling for case if tree has no child.