Let's instead fix the bug at it source. Either modify keyboard.setLayoutPage() to use the default when no argument is passed, or pass the default layout page as part of the keyboard object so that line 386 turns into:

  keyboard.setLayoutPage()
or 
  keyboard.setLayoutPage(keyboard.defaultLayoutPage)

This will require changes to keyboard.js:1735.

Actually, since we only call setLayoutPage() once, maybe just change that function to resetLayoutPage() and have it restore to the default layout.