Fix binary search