The current binary search fails on bug and was pushed to the master untested. The initial implementation done by me took care of the edge cases in the base exit condition.
@nikitap492 The code was changed by you where the base condition is changed. Was your PR reviewed by someone and did you added the edge case tests?