fix(typeahead): corrections for bugs #2293, #2535

fix for #2293 replaces https://github.com/angular-ui/bootstrap/pull/2535 since test coverage was never updated.