Fixes for circular binary search