Segment tree initialization issue