diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index 86dbf1f..a7b695e 100644
--- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -260,7 +260,8 @@
         mMode = mode;
         mImeOptions = imeOptions;
         if (enableVoice != mHasVoice) {
-            setVoiceMode(mHasVoice, mVoiceOnPrimary);
+            // TODO clean up this unnecessary recursive call.
+            setVoiceMode(enableVoice, mVoiceOnPrimary);
         }
         mIsSymbols = isSymbols;
 
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 4e0f7c5..b6fee11 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -2329,8 +2329,8 @@
 
     private boolean shouldShowVoiceButton(FieldContext fieldContext, EditorInfo attribute) {
         return ENABLE_VOICE_BUTTON && fieldCanDoVoice(fieldContext)
-                && !(attribute != null && attribute.privateImeOptions != null
-                        && attribute.privateImeOptions.equals(IME_OPTION_NO_MICROPHONE))
+                && !(attribute != null
+                        && IME_OPTION_NO_MICROPHONE.equals(attribute.privateImeOptions))
                 && SpeechRecognizer.isRecognitionAvailable(this);
     }
 
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
index cf702f3..e33ae14 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
@@ -336,7 +336,7 @@
             mMicIcon = mRes.getDrawable(R.drawable.sym_keyboard_mic);
             m123MicIcon = mRes.getDrawable(R.drawable.sym_keyboard_123_mic);
         }
-        updateF1Key();
+        updateDynamicKeys();
         if (mSpaceKey != null) {
             updateSpaceBarForLocale(isAutoCompletion, isBlack);
         }
@@ -350,11 +350,11 @@
     public void setVoiceMode(boolean hasVoiceButton, boolean hasVoice) {
         mHasVoiceButton = hasVoiceButton;
         mVoiceEnabled = hasVoice;
-        updateF1Key();
+        updateDynamicKeys();
     }
 
-    private void updateF1Key() {
-        if (mF1Key == null) return;
+    private void updateDynamicKeys() {
+        // Update KEYCODE_MODE_CHANGE key only on alphabet mode, not on symbol mode.
         if (m123Key != null && mIsAlphaKeyboard) {
             if (mVoiceEnabled && !mHasVoiceButton) {
                 m123Key.icon = m123MicIcon;
@@ -367,23 +367,26 @@
             }
         }
 
-        if (mHasVoiceButton && mVoiceEnabled) {
-            mF1Key.codes = new int[] { LatinKeyboardView.KEYCODE_VOICE };
-            mF1Key.label = null;
-            // HACK: draw mMicIcon and mF1HintIcon at the same time
-            mF1Key.icon = new BitmapDrawable(mRes, drawSynthesizedSettingsHintImage(
-                    mF1Key.width, mF1Key.height + mVerticalGap, mMicIcon, mF1HintIcon));
-            mF1Key.iconPreview = mMicPreviewIcon;
-            mF1Key.popupResId = R.xml.popup_mic;
-        } else {
-            mF1Key.label = ",";
-            mF1Key.codes = new int[] { ',' };
-            // HACK: draw only mF1HintIcon on offscreen buffer to adjust position of '...' to the
-            // above synthesized icon
-            mF1Key.icon = new BitmapDrawable(mRes, drawSynthesizedSettingsHintImage(
-                    mF1Key.width, mF1Key.height + mVerticalGap, null, mF1HintIcon));
-            mF1Key.iconPreview = null;
-            mF1Key.popupResId = R.xml.popup_comma;
+        // Update KEYCODE_F1 key. Please note that some keyboard layout has no F1 key.
+        if (mF1Key != null) {
+            if (mHasVoiceButton && mVoiceEnabled) {
+                mF1Key.codes = new int[] { LatinKeyboardView.KEYCODE_VOICE };
+                mF1Key.label = null;
+                // HACK: draw mMicIcon and mF1HintIcon at the same time
+                mF1Key.icon = new BitmapDrawable(mRes, drawSynthesizedSettingsHintImage(
+                        mF1Key.width, mF1Key.height + mVerticalGap, mMicIcon, mF1HintIcon));
+                mF1Key.iconPreview = mMicPreviewIcon;
+                mF1Key.popupResId = R.xml.popup_mic;
+            } else {
+                mF1Key.label = ",";
+                mF1Key.codes = new int[] { ',' };
+                // HACK: draw only mF1HintIcon on offscreen buffer to adjust position of '...' to
+                // the above synthesized icon
+                mF1Key.icon = new BitmapDrawable(mRes, drawSynthesizedSettingsHintImage(
+                        mF1Key.width, mF1Key.height + mVerticalGap, null, mF1HintIcon));
+                mF1Key.iconPreview = null;
+                mF1Key.popupResId = R.xml.popup_comma;
+            }
         }
     }
 
