Fixed handling of keyboard shortcuts