diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index db0a8a8..71355f4 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -94,8 +94,8 @@
             final boolean blockOffensiveWords, final boolean isCorrectionEnabled,
             final int[] additionalFeaturesOptions, final int sequenceNumber,
             final OnGetSuggestedWordsCallback callback) {
-        final int trailingSingleQuotesCount = wordComposer.trailingSingleQuotesCount();
         final String typedWord = wordComposer.getTypedWord();
+        final int trailingSingleQuotesCount = StringUtils.getTrailingSingleQuotesCount(typedWord);
         final String consideredWord = trailingSingleQuotesCount > 0
                 ? typedWord.substring(0, typedWord.length() - trailingSingleQuotesCount)
                 : typedWord;
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index ac69729..9cf71c7 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -149,7 +149,8 @@
     public int copyCodePointsExceptTrailingSingleQuotesAndReturnCodePointCount(
             final int[] destination) {
         // lastIndex is exclusive
-        final int lastIndex = mTypedWordCache.length() - trailingSingleQuotesCount();
+        final int lastIndex = mTypedWordCache.length()
+                - StringUtils.getTrailingSingleQuotesCount(mTypedWordCache);
         if (lastIndex <= 0) {
             // The string is empty or contains only single quotes.
             return 0;
@@ -331,15 +332,6 @@
         return mIsFirstCharCapitalized;
     }
 
-    public int trailingSingleQuotesCount() {
-        final int lastIndex = mTypedWordCache.length() - 1;
-        int i = lastIndex;
-        while (i >= 0 && mTypedWordCache.charAt(i) == Constants.CODE_SINGLE_QUOTE) {
-            --i;
-        }
-        return lastIndex - i;
-    }
-
     /**
      * Whether or not all of the user typed chars are upper case
      * @return true if all user typed chars are upper case, false otherwise
diff --git a/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java b/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java
index afacd08..6ef505e 100644
--- a/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java
+++ b/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java
@@ -138,11 +138,13 @@
                 }
             }
             dictionaryMap.clear();
-            if (!FileUtils.deleteFilteredFiles(
-                    context.getFilesDir(), new DictFilter(dictNamePrefix))) {
+            final File filesDir = context.getFilesDir();
+            if (filesDir == null) {
+                Log.e(TAG, "context.getFilesDir() returned null.");
+            }
+            if (!FileUtils.deleteFilteredFiles(filesDir, new DictFilter(dictNamePrefix))) {
                 Log.e(TAG, "Cannot remove all existing dictionary files. filesDir: "
-                        + context.getFilesDir().getAbsolutePath() + ", dictNamePrefix: "
-                        + dictNamePrefix);
+                        + filesDir.getAbsolutePath() + ", dictNamePrefix: " + dictNamePrefix);
             }
         }
     }
diff --git a/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java b/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java
index 0a03799..dc3e9bf 100644
--- a/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java
+++ b/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java
@@ -86,9 +86,10 @@
         coordinates = mKeyboard.getCoordinates(codePoints);
         composer.setComposingWord(codePoints, coordinates, prevWord);
 
-        final int trailingSingleQuotesCount = composer.trailingSingleQuotesCount();
-        final String consideredWord = trailingSingleQuotesCount > 0 ? testedWord.substring(0,
-                testedWord.length() - trailingSingleQuotesCount) : testedWord;
+        final int trailingSingleQuotesCount = StringUtils.getTrailingSingleQuotesCount(testedWord);
+        final String consideredWord = trailingSingleQuotesCount > 0 ?
+                testedWord.substring(0, testedWord.length() - trailingSingleQuotesCount) :
+                testedWord;
         final AsyncResultHolder<Boolean> holder = new AsyncResultHolder<Boolean>();
         final OnGetSuggestedWordsCallback callback = new OnGetSuggestedWordsCallback() {
             @Override
diff --git a/java/src/com/android/inputmethod/latin/utils/StringUtils.java b/java/src/com/android/inputmethod/latin/utils/StringUtils.java
index 374badc..73ac9a5 100644
--- a/java/src/com/android/inputmethod/latin/utils/StringUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/StringUtils.java
@@ -538,6 +538,15 @@
                 ? casedText.codePointAt(0) : CODE_UNSPECIFIED;
     }
 
+    public static int getTrailingSingleQuotesCount(final CharSequence charSequence) {
+        final int lastIndex = charSequence.length() - 1;
+        int i = lastIndex;
+        while (i >= 0 && charSequence.charAt(i) == Constants.CODE_SINGLE_QUOTE) {
+            --i;
+        }
+        return lastIndex - i;
+    }
+
     @UsedForTesting
     public static class Stringizer<E> {
         public String stringize(final E element) {
diff --git a/tests/src/com/android/inputmethod/latin/utils/StringAndJsonUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/StringAndJsonUtilsTests.java
index 2a4ead3..bdc608a 100644
--- a/tests/src/com/android/inputmethod/latin/utils/StringAndJsonUtilsTests.java
+++ b/tests/src/com/android/inputmethod/latin/utils/StringAndJsonUtilsTests.java
@@ -372,4 +372,14 @@
         assertTrue("copyCodePointsAndReturnCodePointCount throws when array is too small",
                 exceptionHappened);
     }
+
+    public void testGetTrailingSingleQuotesCount() {
+        assertEquals(0, StringUtils.getTrailingSingleQuotesCount(""));
+        assertEquals(1, StringUtils.getTrailingSingleQuotesCount("'"));
+        assertEquals(5, StringUtils.getTrailingSingleQuotesCount("'''''"));
+        assertEquals(0, StringUtils.getTrailingSingleQuotesCount("a"));
+        assertEquals(0, StringUtils.getTrailingSingleQuotesCount("'this"));
+        assertEquals(1, StringUtils.getTrailingSingleQuotesCount("'word'"));
+        assertEquals(0, StringUtils.getTrailingSingleQuotesCount("I'm"));
+    }
 }
