Fix searching for terms that were strict prefixes of longer items.