Fix bug with keyboard selection