diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index f7d34c8..2a47d7a 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -409,26 +409,27 @@
     <!-- Title of the button to revert to the default value of the device in the settings dialog [CHAR LIMIT=15] -->
     <string name="button_default">Default</string>
 
+    <!-- TODO: Remove translatable="false" once wordings are finalized. -->
     <!-- Title of the setup wizard. [CHAR LIMT=40] -->
-    <string name="setup_title">"Installing <xliff:g id="application_name">%s</xliff:g>"</string>
+    <string name="setup_title" translatable="false">"Installing <xliff:g id="application_name">%s</xliff:g>"</string>
     <!-- Ordinal number of the 1st step in the setup wizard. [CHAR LIMIT=5] -->
-    <string name="setup_step1_bullet">1</string>
+    <string name="setup_step1_bullet" translatable="false">1</string>
     <!-- Title of the 1st step in the setup wizard. [CHAR LIMIT=64] -->
-    <string name="setup_step1_title">"Enable <xliff:g id="application_name">%s</xliff:g> in settings."</string>
+    <string name="setup_step1_title" translatable="false">"Enable <xliff:g id="application_name">%s</xliff:g> in settings."</string>
     <!-- Detailed instruction of the 1st step in the setup wizard. [CHAR LIMIT=80] -->
-    <string name="setup_step1_instruction">"For security, please check \"<xliff:g id="application_name">%s</xliff:g>\""</string>
+    <string name="setup_step1_instruction" translatable="false">"For security, please check \"<xliff:g id="application_name">%s</xliff:g>\""</string>
     <!-- Ordinal number of the 2nd step in the setup wizard. [CHAR LIMIT=5] -->
-    <string name="setup_step2_bullet">2</string>
+    <string name="setup_step2_bullet" translatable="false">2</string>
     <!-- Title of the 2nd step in the setup wizard. [CHAR LIMIT=64] -->
-    <string name="setup_step2_title">"Switch to <xliff:g id="application_name">%s</xliff:g>."</string>
+    <string name="setup_step2_title" translatable="false">"Switch to <xliff:g id="application_name">%s</xliff:g>."</string>
     <!-- Detailed instruction of the 2nd step in the setup wizard. [CHAR LIMIT=80] -->
-    <string name="setup_step2_instruction">"Now that you've enabled <xliff:g id="application_name">%s</xliff:g>, you can switch to it."</string>
+    <string name="setup_step2_instruction" translatable="false">"Now that you've enabled <xliff:g id="application_name">%s</xliff:g>, you can switch to it."</string>
     <!-- Ordinal number of the 3rd step in the setup wizard. [CHAR LIMIT=5] -->
-    <string name="setup_step3_bullet">3</string>
+    <string name="setup_step3_bullet" translatable="false">3</string>
     <!-- Title of the 3rd step in the setup wizard. [CHAR LIMIT=64] -->
-    <string name="setup_step3_title">"Congratulations, you're all set!"</string>
+    <string name="setup_step3_title" translatable="false">"Congratulations, you're all set!"</string>
     <!-- Detailed instruction of the 3rd step in the setup wizard. [CHAR LIMIT=80] -->
-    <string name="setup_step3_instruction">Configure additional languages</string>
+    <string name="setup_step3_instruction" translatable="false">Configure additional languages</string>
     <!-- Title of the Language & input settings. This should be aligned with msgid="5292716747264442359" -->
     <string name="language_settings">Language &amp; input</string>
     <!-- Title of the Input method picker. This should be aligned with msgid="4653387336791222978" -->
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 365c35b..350dc69 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -635,15 +635,9 @@
         invalidate(x, y, x + key.mWidth, y + key.mHeight);
     }
 
-    // TODO: Remove this method.
-    public void closing() {
-        mInvalidateAllKeys = true;
-    }
-
     @Override
     protected void onDetachedFromWindow() {
         super.onDetachedFromWindow();
-        closing();
         freeOffscreenBuffer();
     }
 }
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 4d10f0e..bc27f85 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -1236,13 +1236,11 @@
         mDrawingHandler.cancelAllMessages();
     }
 
-    @Override
     public void closing() {
         dismissAllKeyPreviews();
         cancelAllMessages();
         onDismissMoreKeysPanel();
         mMoreKeysKeyboardCache.clear();
-        super.closing();
     }
 
     /**
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
index 9e75f8b..0d42ab2 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
@@ -174,7 +174,6 @@
 
     @Override
     public boolean dismissMoreKeysPanel() {
-        super.closing();
         if (mController == null) return false;
         return mController.onDismissMoreKeysPanel();
     }
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 20209b6..e934746 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -132,6 +132,8 @@
     private View mKeyPreviewBackingView;
     private View mSuggestionsContainer;
     private SuggestionStripView mSuggestionStripView;
+    // Never null
+    private SuggestedWords mSuggestedWords = SuggestedWords.EMPTY;
     @UsedForTesting Suggest mSuggest;
     private CompletionInfo[] mApplicationSpecifiedCompletions;
     private ApplicationInfo mTargetApplicationInfo;
@@ -728,6 +730,7 @@
             // otherwise it will clear the suggestion strip.
             setPunctuationSuggestions();
         }
+        mSuggestedWords = SuggestedWords.EMPTY;
 
         mConnection.resetCachesUponCursorMove(editorInfo.initialSelStart);
 
@@ -992,7 +995,7 @@
                 false /* isPrediction */);
         // When in fullscreen mode, show completions generated by the application
         final boolean isAutoCorrection = false;
-        setSuggestionStrip(suggestedWords, isAutoCorrection);
+        setSuggestedWords(suggestedWords, isAutoCorrection);
         setAutoCorrectionIndicator(isAutoCorrection);
         setSuggestionStripShown(true);
         if (ProductionFlag.IS_EXPERIMENTAL) {
@@ -1117,7 +1120,7 @@
         if (mSettings.getCurrent().mBigramPredictionEnabled) {
             clearSuggestionStrip();
         } else {
-            setSuggestionStrip(mSettings.getCurrent().mSuggestPuncList, false);
+            setSuggestedWords(mSettings.getCurrent().mSuggestPuncList, false);
         }
         mConnection.resetCachesUponCursorMove(newCursorPosition);
     }
@@ -1980,8 +1983,8 @@
     // Outside LatinIME, only used by the test suite.
     @UsedForTesting
     boolean isShowingPunctuationList() {
-        if (mSuggestionStripView == null) return false;
-        return mSettings.getCurrent().mSuggestPuncList == mSuggestionStripView.getSuggestions();
+        if (mSuggestedWords == null) return false;
+        return mSettings.getCurrent().mSuggestPuncList == mSuggestedWords;
     }
 
     private boolean isSuggestionsStripVisible() {
@@ -1997,11 +2000,12 @@
     }
 
     private void clearSuggestionStrip() {
-        setSuggestionStrip(SuggestedWords.EMPTY, false);
+        setSuggestedWords(SuggestedWords.EMPTY, false);
         setAutoCorrectionIndicator(false);
     }
 
-    private void setSuggestionStrip(final SuggestedWords words, final boolean isAutoCorrection) {
+    private void setSuggestedWords(final SuggestedWords words, final boolean isAutoCorrection) {
+        mSuggestedWords = words;
         if (mSuggestionStripView != null) {
             mSuggestionStripView.setSuggestions(words);
             mKeyboardSwitcher.onAutoCorrectionStateChanged(isAutoCorrection);
@@ -2084,15 +2088,16 @@
     }
 
     private SuggestedWords getOlderSuggestions(final String typedWord) {
-        SuggestedWords previousSuggestions = mSuggestionStripView.getSuggestions();
-        if (previousSuggestions == mSettings.getCurrent().mSuggestPuncList) {
-            previousSuggestions = SuggestedWords.EMPTY;
+        SuggestedWords previousSuggestedWords = mSuggestedWords;
+        if (previousSuggestedWords == mSettings.getCurrent().mSuggestPuncList) {
+            previousSuggestedWords = SuggestedWords.EMPTY;
         }
         if (typedWord == null) {
-            return previousSuggestions;
+            return previousSuggestedWords;
         }
         final ArrayList<SuggestedWords.SuggestedWordInfo> typedWordAndPreviousSuggestions =
-                SuggestedWords.getTypedWordAndPreviousSuggestions(typedWord, previousSuggestions);
+                SuggestedWords.getTypedWordAndPreviousSuggestions(typedWord,
+                        previousSuggestedWords);
         return new SuggestedWords(typedWordAndPreviousSuggestions,
                 false /* typedWordValid */,
                 false /* hasAutoCorrectionCandidate */,
@@ -2114,7 +2119,7 @@
         }
         mWordComposer.setAutoCorrection(autoCorrection);
         final boolean isAutoCorrection = suggestedWords.willAutoCorrect();
-        setSuggestionStrip(suggestedWords, isAutoCorrection);
+        setSuggestedWords(suggestedWords, isAutoCorrection);
         setAutoCorrectionIndicator(isAutoCorrection);
         setSuggestionStripShown(isSuggestionsStripVisible());
     }
@@ -2137,7 +2142,7 @@
                 Stats.onAutoCorrection(typedWord, autoCorrection, separatorString, mWordComposer);
             }
             if (ProductionFlag.IS_EXPERIMENTAL) {
-                final SuggestedWords suggestedWords = mSuggestionStripView.getSuggestions();
+                final SuggestedWords suggestedWords = mSuggestedWords;
                 ResearchLogger.latinIme_commitCurrentAutoCorrection(typedWord, autoCorrection,
                         separatorString, mWordComposer.isBatchMode(), suggestedWords);
             }
@@ -2162,7 +2167,7 @@
     // interface
     @Override
     public void pickSuggestionManually(final int index, final String suggestion) {
-        final SuggestedWords suggestedWords = mSuggestionStripView.getSuggestions();
+        final SuggestedWords suggestedWords = mSuggestedWords;
         // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput
         if (suggestion.length() == 1 && isShowingPunctuationList()) {
             // Word separators are suggested before the user inputs something.
@@ -2194,6 +2199,7 @@
         if (mSettings.getCurrent().isApplicationSpecifiedCompletionsOn()
                 && mApplicationSpecifiedCompletions != null
                 && index >= 0 && index < mApplicationSpecifiedCompletions.length) {
+            mSuggestedWords = SuggestedWords.EMPTY;
             if (mSuggestionStripView != null) {
                 mSuggestionStripView.clear();
             }
@@ -2249,7 +2255,7 @@
      */
     private void commitChosenWord(final String chosenWord, final int commitType,
             final String separatorString) {
-        final SuggestedWords suggestedWords = mSuggestionStripView.getSuggestions();
+        final SuggestedWords suggestedWords = mSuggestedWords;
         mConnection.commitText(SuggestionSpanUtils.getTextWithSuggestionSpan(
                 this, chosenWord, suggestedWords, mIsMainDictionaryAvailable), 1);
         // Add the word to the user history dictionary
@@ -2266,7 +2272,7 @@
         if (mSettings.getCurrent().mBigramPredictionEnabled) {
             clearSuggestionStrip();
         } else {
-            setSuggestionStrip(mSettings.getCurrent().mSuggestPuncList, false);
+            setSuggestedWords(mSettings.getCurrent().mSuggestPuncList, false);
         }
         setAutoCorrectionIndicator(false);
         setSuggestionStripShown(isSuggestionsStripVisible());
@@ -2563,6 +2569,12 @@
         dialog.show();
     }
 
+    // TODO: can this be removed somehow without breaking the tests?
+    @UsedForTesting
+    /* package for test */ String getFirstSuggestedWord() {
+        return mSuggestedWords.size() > 0 ? mSuggestedWords.getWord(0) : null;
+    }
+
     public void debugDumpStateAndCrashWithException(final String context) {
         final StringBuilder s = new StringBuilder();
         s.append("Target application : ").append(mTargetApplicationInfo.name)
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
index bc51d5d..5a29eee 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
@@ -644,10 +644,6 @@
         return false;
     }
 
-    public SuggestedWords getSuggestions() {
-        return mSuggestedWords;
-    }
-
     public void clear() {
         mSuggestionsStrip.removeAllViews();
         removeAllViews();
diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h
index 28fe1fe..a84dfdd 100644
--- a/native/jni/src/defines.h
+++ b/native/jni/src/defines.h
@@ -398,8 +398,10 @@
     EQUIVALENT_CHAR,
     // It is a char located nearby on the keyboard
     NEAR_PROXIMITY_CHAR,
-    // It is an unrelated char
+    // It is an unrelated char and could be a substitution char
     UNRELATED_CHAR,
+    // It is an unrelated char nor a substitution char
+    UNRELATED_NOR_SUBSTITUTION_CHAR,
     // Additional proximity char which can differ by language.
     ADDITIONAL_PROXIMITY_CHAR
 } ProximityType;
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java
index 005f8b2..333b602 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java
@@ -74,15 +74,22 @@
     public void testWordThenSpaceDisplaysPredictions() {
         final String WORD_TO_TYPE = "beaujolais ";
         final String EXPECTED_RESULT = "nouveau";
-        changeLanguage("fr");
-        type(WORD_TO_TYPE);
-        sleep(DELAY_TO_WAIT_FOR_UNDERLINE);
-        runMessages();
-        final SuggestionStripView suggestionStripView =
-                (SuggestionStripView)mInputView.findViewById(R.id.suggestion_strip_view);
-        final SuggestedWords suggestedWords = suggestionStripView.getSuggestions();
-        assertEquals("type word then type space yields predictions for French",
-                EXPECTED_RESULT, suggestedWords.getWord(0));
+        final boolean defaultNextWordPredictionOption =
+                mLatinIME.getResources().getBoolean(R.bool.config_default_next_word_prediction);
+        final boolean previousNextWordPredictionOption =
+                setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, true,
+                        defaultNextWordPredictionOption);
+        try {
+            changeLanguage("fr");
+            type(WORD_TO_TYPE);
+            sleep(DELAY_TO_WAIT_FOR_UNDERLINE);
+            runMessages();
+            assertEquals("type word then type space yields predictions for French",
+                    EXPECTED_RESULT, mLatinIME.getFirstSuggestedWord());
+        } finally {
+            setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, previousNextWordPredictionOption,
+                    defaultNextWordPredictionOption);
+        }
     }
 
     public void testAutoCorrectForGerman() {
