Fix bug in shortcut handling