Typeahead and dom fixes