Fix error in Segment Tree, add Upper/Lower bound functions