Fixes for keyboard events