Fixes a problem with keypresses.