Fixed autocomplete selection bug