Tab and Shift-Tab key behavior improvement