Fix autocomplete handling

Fix for autocomplete handling.