More fixes to autocomplete