Fixed an infinite recursion stack overflow in the light tree building code.