diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 42af8a8..68d3ccd 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -161,9 +161,10 @@
             final Keyboard oldKeyboard = mInputView.getKeyboard();
             loadKeyboardInternal(mode, imeOptions, voiceKeyEnabled, voiceButtonOnPrimary, false);
             final Keyboard newKeyboard = mInputView.getKeyboard();
-            if (newKeyboard.isAlphaKeyboard() && (oldKeyboard == null
-                    || !newKeyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale))) {
-                mInputMethodService.mHandler.startDisplayLanguageOnSpacebar();
+            if (newKeyboard.isAlphaKeyboard()) {
+                final boolean localeChanged = (oldKeyboard == null)
+                        || !newKeyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
+                mInputMethodService.mHandler.startDisplayLanguageOnSpacebar(localeChanged);
             }
         } catch (RuntimeException e) {
             Log.w(TAG, e);
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index b1815a1..766fdf0 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -1404,11 +1404,15 @@
         dismissPopupKeyboard();
         mBuffer = null;
         mCanvas = null;
-        mKeyboard = null;
         mMiniKeyboardCache.clear();
         requestLayout();
     }
 
+    public void purgeKeyboardAndClosing() {
+        mKeyboard = null;
+        closing();
+    }
+
     @Override
     public void onDetachedFromWindow() {
         super.onDetachedFromWindow();
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 5766f6b..cd4143e 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -154,7 +154,7 @@
     private boolean mConfigSwipeDownDismissKeyboardEnabled;
     private int mConfigDelayBeforeFadeoutLanguageOnSpacebar;
     private int mConfigDurationOfFadeoutLanguageOnSpacebar;
-    private float mConfigFinalFadeoutFactorOfLanugageOnSpacebar;
+    private float mConfigFinalFadeoutFactorOfLanguageOnSpacebar;
 
     private int mCorrectionMode;
     private int mCommittedLength;
@@ -269,7 +269,7 @@
             case MSG_FADEOUT_LANGUAGE_ON_SPACEBAR:
                 if (inputView != null)
                     inputView.setSpacebarTextFadeFactor(
-                            (1.0f + mConfigFinalFadeoutFactorOfLanugageOnSpacebar) / 2,
+                            (1.0f + mConfigFinalFadeoutFactorOfLanguageOnSpacebar) / 2,
                             (LatinKeyboard)msg.obj);
                 sendMessageDelayed(obtainMessage(MSG_DISMISS_LANGUAGE_ON_SPACEBAR, msg.obj),
                         mConfigDurationOfFadeoutLanguageOnSpacebar);
@@ -277,7 +277,7 @@
             case MSG_DISMISS_LANGUAGE_ON_SPACEBAR:
                 if (inputView != null)
                     inputView.setSpacebarTextFadeFactor(
-                            mConfigFinalFadeoutFactorOfLanugageOnSpacebar, (LatinKeyboard)msg.obj);
+                            mConfigFinalFadeoutFactorOfLanguageOnSpacebar, (LatinKeyboard)msg.obj);
                 break;
             }
         }
@@ -318,7 +318,7 @@
             sendMessage(obtainMessage(MSG_VOICE_RESULTS));
         }
 
-        public void startDisplayLanguageOnSpacebar() {
+        public void startDisplayLanguageOnSpacebar(boolean localeChanged) {
             removeMessages(MSG_FADEOUT_LANGUAGE_ON_SPACEBAR);
             removeMessages(MSG_DISMISS_LANGUAGE_ON_SPACEBAR);
             final LatinKeyboardView inputView = mKeyboardSwitcher.getInputView();
@@ -326,9 +326,10 @@
                 final LatinKeyboard keyboard = inputView.getLatinKeyboard();
                 // The language is never displayed when the delay is zero.
                 if (mConfigDelayBeforeFadeoutLanguageOnSpacebar != 0)
-                    inputView.setSpacebarTextFadeFactor(1.0f, keyboard);
+                    inputView.setSpacebarTextFadeFactor(localeChanged ? 1.0f
+                            : mConfigFinalFadeoutFactorOfLanguageOnSpacebar, keyboard);
                 // The language is always displayed when the delay is negative.
-                if (mConfigDelayBeforeFadeoutLanguageOnSpacebar > 0) {
+                if (localeChanged && mConfigDelayBeforeFadeoutLanguageOnSpacebar > 0) {
                     sendMessageDelayed(obtainMessage(MSG_FADEOUT_LANGUAGE_ON_SPACEBAR, keyboard),
                             mConfigDelayBeforeFadeoutLanguageOnSpacebar);
                 }
@@ -360,7 +361,7 @@
                 R.integer.config_delay_before_fadeout_language_on_spacebar);
         mConfigDurationOfFadeoutLanguageOnSpacebar = res.getInteger(
                 R.integer.config_duration_of_fadeout_language_on_spacebar);
-        mConfigFinalFadeoutFactorOfLanugageOnSpacebar = res.getInteger(
+        mConfigFinalFadeoutFactorOfLanguageOnSpacebar = res.getInteger(
                 R.integer.config_final_fadeout_percentage_of_language_on_spacebar) / 100.0f;
 
         Utils.GCUtils.getInstance().reset();
diff --git a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java b/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
index 7154861..9a6c3a8 100644
--- a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
+++ b/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
@@ -631,7 +631,7 @@
         if (mSubtypeSwitcher.isVoiceMode() && token != null) {
             // Close keyboard view if it is been shown.
             if (KeyboardSwitcher.getInstance().isInputViewShown())
-                KeyboardSwitcher.getInstance().getInputView().closing();
+                KeyboardSwitcher.getInstance().getInputView().purgeKeyboardAndClosing();
             startListening(false, token, false);
         }
         // If we have no token, onAttachedToWindow will take care of showing dialog and start
