Fixed stack overflow in KdTree.allSplits.