Fix Tab and Shift-Tab keys to work as expected