Fix arrow key handling