Fix #494: make Keyboard more resilient against structure resets