Binary search fix