fixes inaccurate results

On filling the cache, beware of intervals whose LCP is longer than the current position. Previous to this commit incorrect paths in the suffix tree were followed and hence an incorrect cache was created. Now, for such cases, the code falls back to a non-cached search. The performance impact of this needs to be evaluated and might be due to changes in the future.