Fixes some buggy tab and arrow key behaviour.