Tweak autocomplete logic for big speedup.