},
   switch_mode: function(mode_name) {
     this.inputEl.focus();
-    //this.show_help = false;
     this.map_mode = 'terrain';
+    this.mode = this['mode_' + mode_name];
     if (this.mode.shows_info && game.player_id in game.things) {
       explorer.position = game.things[game.player_id].position;
       explorer.query_info();
     }
-    this.mode = this['mode_' + mode_name];
     this.empty_input();
     this.restore_input_values();
     document.getElementById("take_thing").disabled = true;
             document.getElementById("move_down").disabled = false;
         }
     }
-    if (!this.mode.is_intro && this.mode != this.mode_play) {
+    if (!this.mode.is_intro && this.mode.name != 'play') {
         document.getElementById("switch_to_play").disabled = false;
     }
-    if (!this.mode.is_intro && this.mode != this.mode_study) {
+    if (!this.mode.is_intro && this.mode.name != 'study') {
         document.getElementById("switch_to_study").disabled = false;
     }
-    if (!this.mode.is_intro && this.mode != this.mode_chat) {
+    if (!this.mode.is_intro && this.mode.name != 'chat') {
         document.getElementById("switch_to_chat").disabled = false;
     }
     if (this.mode.name == 'login') {