Refs #9720 Restructure GUI code to prevent it accidentally quitting.
Refs #9720 Fix typo.