Fix index query so it is slightly less worse

Fix index query so it is slightly less worse and doesn't bail out when first or last target has no entries (it will still bail if no reads are mapped)