Fixed some sync issues in autocomplete. Fixed the on_dom_change problem