Fix typo in rejecting invalid keycodes