Fix a bug with autocomplete