diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
index d6dfd0d..77dde8d 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
@@ -48,7 +48,7 @@
     private final Drawable mButtonArrowLeftIcon;
     private final Drawable mButtonArrowRightIcon;
     private final int mSpaceBarTextShadowColor;
-    private int mSpaceKeyIndex = -1;
+    private final int[] mSpaceKeyIndexArray;
     private int mSpaceDragStartX;
     private int mSpaceDragLastDiff;
     private final Context mContext;
@@ -92,7 +92,8 @@
         mButtonArrowRightIcon = res.getDrawable(R.drawable.sym_keyboard_language_arrows_right);
         sSpacebarVerticalCorrection = res.getDimensionPixelOffset(
                 R.dimen.spacebar_vertical_correction);
-        mSpaceKeyIndex = indexOf(CODE_SPACE);
+        // The index of space key is available only after Keyboard constructor has finished.
+        mSpaceKeyIndexArray = new int[] { indexOf(CODE_SPACE) };
     }
 
     /**
@@ -418,7 +419,7 @@
     @Override
     public int[] getNearestKeys(int x, int y) {
         if (mCurrentlyInSpace) {
-            return new int[] { mSpaceKeyIndex };
+            return mSpaceKeyIndexArray;
         } else {
             // Avoid dead pixels at edges of the keyboard
             return super.getNearestKeys(Math.max(0, Math.min(x, getMinWidth() - 1)),
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
index 6b052c7..51bfbf1 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
@@ -62,13 +62,18 @@
         }
     }
 
-    public void setLatinKeyboard(LatinKeyboard k) {
-        super.setKeyboard(k);
+    public void setLatinKeyboard(LatinKeyboard newKeyboard) {
+        final LatinKeyboard oldKeyboard = getLatinKeyboard();
+        if (oldKeyboard != null) {
+            // Reset old keyboard state before switching to new keyboard.
+            oldKeyboard.keyReleased();
+        }
+        super.setKeyboard(newKeyboard);
         // One-seventh of the keyboard width seems like a reasonable threshold
-        mJumpThresholdSquare = k.getMinWidth() / 7;
+        mJumpThresholdSquare = newKeyboard.getMinWidth() / 7;
         mJumpThresholdSquare *= mJumpThresholdSquare;
         // Assuming there are 4 rows, this is the coordinate of the last row
-        mLastRowY = (k.getHeight() * 3) / 4;
+        mLastRowY = (newKeyboard.getHeight() * 3) / 4;
     }
 
     public LatinKeyboard getLatinKeyboard() {
