Multiple reflection rays failure

Something is going wrong while the tree is being constructed.  It's
caught in some kind of infinite process, but only when the number of
reflection rays is greater than 1.
Even when the number is 1, the function picking a random ray in a cone
isn't working correctly.