Minor fix to TypeAhead function