Fixed Binary Search Bug