Small cleanup of keyboard code.