fixed typos
better handling of TAB key