diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
index f4300c4..5f2a112 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
@@ -95,7 +95,7 @@
         try {
             afd = context.getResources().openRawResourceFd(fallbackResId);
         } catch (RuntimeException e) {
-            Log.e(TAG, "Resource not found: " + fallbackResId, e);
+            Log.e(TAG, "Resource not found: " + fallbackResId);
             return null;
         }
         if (afd == null) {
@@ -273,12 +273,14 @@
      * @return The list of addresses of valid dictionary files, or null.
      */
     public static ArrayList<AssetFileAddress> getDictionaryFiles(final Locale locale,
-            final Context context) {
+            final Context context, boolean notifyDictionaryPackForUpdates) {
 
         final boolean hasDefaultWordList = DictionaryInfoUtils.isDictionaryAvailable(
                 context, locale);
-        BinaryDictionaryFileDumper.cacheWordListsFromContentProvider(locale, context,
-                hasDefaultWordList);
+        if (notifyDictionaryPackForUpdates) {
+            BinaryDictionaryFileDumper.cacheWordListsFromContentProvider(locale, context,
+                    hasDefaultWordList);
+        }
         final File[] cachedWordLists = getCachedWordLists(locale.toString(), context);
         final String mainDictId = DictionaryInfoUtils.getMainDictId(locale);
         final DictPackSettings dictPackSettings = new DictPackSettings(context);
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFactory.java b/java/src/com/android/inputmethod/latin/DictionaryFactory.java
index 49608d8..5dd02bd 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFactory.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFactory.java
@@ -53,7 +53,7 @@
 
         final LinkedList<Dictionary> dictList = new LinkedList<>();
         final ArrayList<AssetFileAddress> assetFileList =
-                BinaryDictionaryGetter.getDictionaryFiles(locale, context);
+                BinaryDictionaryGetter.getDictionaryFiles(locale, context, true);
         if (null != assetFileList) {
             for (final AssetFileAddress f : assetFileList) {
                 final ReadOnlyBinaryDictionary readOnlyBinaryDictionary =
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
index 00f69f1..7d85170 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
@@ -125,7 +125,12 @@
         return mRecommendedThreshold;
     }
 
-    private static String getKeyboardLayoutNameForScript(final int script) {
+    private static String getKeyboardLayoutNameForLocale(final Locale locale) {
+        // See b/19963288.
+        if (locale.getLanguage().equals("sr")) {
+            return "south_slavic";
+        }
+        final int script = ScriptUtils.getScriptFromSpellCheckerLocale(locale);
         switch (script) {
         case ScriptUtils.SCRIPT_LATIN:
             return "qwerty";
@@ -247,8 +252,7 @@
     }
 
     private Keyboard createKeyboardForLocale(final Locale locale) {
-        final int script = ScriptUtils.getScriptFromSpellCheckerLocale(locale);
-        final String keyboardLayoutName = getKeyboardLayoutNameForScript(script);
+        final String keyboardLayoutName = getKeyboardLayoutNameForLocale(locale);
         final InputMethodSubtype subtype = AdditionalSubtypeUtils.createDummyAdditionalSubtype(
                 locale.toString(), keyboardLayoutName);
         final KeyboardLayoutSet keyboardLayoutSet = createKeyboardSetForSpellChecker(subtype);
