diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 439f125..5098494 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -2038,7 +2038,11 @@
         if (mCorrectionMode == Suggest.CORRECTION_FULL_BIGRAM) {
             final CharSequence prevWord = EditingUtils.getThisWord(getCurrentInputConnection(),
                     mSettingsValues.mWordSeparators);
-            builder = mSuggest.getBigramPredictionWordBuilder(prevWord);
+            if (!TextUtils.isEmpty(prevWord)) {
+                builder = mSuggest.getBigramPredictionWordBuilder(prevWord);
+            } else {
+                builder = null;
+            }
         } else {
             builder = null;
         }
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index b8ec5ff..f3ba1e5 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -276,21 +276,17 @@
         Arrays.fill(mBigramScores, 0);
         collectGarbage(mBigramSuggestions, PREF_MAX_BIGRAMS);
 
-        // Note that if prevWordForBigram is empty, we'll always return the same empty
-        // SuggestedWords.Builder
-        if (!TextUtils.isEmpty(prevWordForBigram)) {
-            CharSequence lowerPrevWord = prevWordForBigram.toString().toLowerCase();
-            if (mMainDict != null && mMainDict.isValidWord(lowerPrevWord)) {
-                prevWordForBigram = lowerPrevWord;
-            }
-            for (final Dictionary dictionary : mBigramDictionaries.values()) {
-                dictionary.getBigrams(sEmptyWordComposer, prevWordForBigram, this);
-            }
-            // Nothing entered: return all bigrams for the previous word
-            int insertCount = Math.min(mBigramSuggestions.size(), mPrefMaxSuggestions);
-            for (int i = 0; i < insertCount; ++i) {
-                addBigramToSuggestions(mBigramSuggestions.get(i));
-            }
+        CharSequence lowerPrevWord = prevWordForBigram.toString().toLowerCase();
+        if (mMainDict != null && mMainDict.isValidWord(lowerPrevWord)) {
+            prevWordForBigram = lowerPrevWord;
+        }
+        for (final Dictionary dictionary : mBigramDictionaries.values()) {
+            dictionary.getBigrams(sEmptyWordComposer, prevWordForBigram, this);
+        }
+        // Nothing entered: return all bigrams for the previous word
+        int insertCount = Math.min(mBigramSuggestions.size(), mPrefMaxSuggestions);
+        for (int i = 0; i < insertCount; ++i) {
+            addBigramToSuggestions(mBigramSuggestions.get(i));
         }
 
         StringUtils.removeDupes(mSuggestions);
