More fixes on autocomplete