Made autocomplete a little more robust