Fixed some bugs with tab autocomplete.