Fix binary search for not mapped index

The corpus sometimes contains space characters which are added as
extra characters by the selection api and not mapped into any node.
This fix handles this case choosing the right neightboor