diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 2711d24..66cb9e3 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -60,7 +60,7 @@
     public static final int THEME_INDEX_ICS = 0;
     public static final int THEME_INDEX_GB = 1;
     public static final int THEME_INDEX_KLP = 2;
-    public static final int THEME_INDEX_DEFAULT = THEME_INDEX_KLP;
+    public static final int DEFAULT_THEME_INDEX = THEME_INDEX_KLP;
     public static final KeyboardTheme[] KEYBOARD_THEMES = {
         new KeyboardTheme(THEME_INDEX_ICS, R.style.KeyboardTheme_ICS),
         new KeyboardTheme(THEME_INDEX_GB, R.style.KeyboardTheme_GB),
@@ -88,7 +88,7 @@
      * what user actually typed. */
     private boolean mIsAutoCorrectionActive;
 
-    private KeyboardTheme mKeyboardTheme = KEYBOARD_THEMES[THEME_INDEX_DEFAULT];
+    private KeyboardTheme mKeyboardTheme = KEYBOARD_THEMES[DEFAULT_THEME_INDEX];
     private Context mThemeContext;
 
     private static final KeyboardSwitcher sInstance = new KeyboardSwitcher();
diff --git a/java/src/com/android/inputmethod/latin/settings/Settings.java b/java/src/com/android/inputmethod/latin/settings/Settings.java
index b51c765..964bf22 100644
--- a/java/src/com/android/inputmethod/latin/settings/Settings.java
+++ b/java/src/com/android/inputmethod/latin/settings/Settings.java
@@ -23,6 +23,7 @@
 import android.preference.PreferenceManager;
 import android.util.Log;
 
+import com.android.inputmethod.keyboard.KeyboardSwitcher;
 import com.android.inputmethod.latin.AudioAndHapticFeedbackManager;
 import com.android.inputmethod.latin.InputAttributes;
 import com.android.inputmethod.latin.R;
@@ -270,25 +271,36 @@
     }
 
     public static int readKeyboardThemeIndex(final SharedPreferences prefs, final Resources res) {
-        final String defaultThemeIndex = res.getString(
-                R.string.config_default_keyboard_theme_index);
-        final String themeIndex = prefs.getString(PREF_KEYBOARD_LAYOUT, defaultThemeIndex);
+        final int defaultThemeIndex = readDefaultKeyboardThemeIndex(res);
+        final String themeIndexString = prefs.getString(PREF_KEYBOARD_LAYOUT, null);
         try {
-            return Integer.valueOf(themeIndex);
+            return Integer.parseInt(themeIndexString);
         } catch (final NumberFormatException e) {
             // Format error, returns default keyboard theme index.
-            Log.e(TAG, "Illegal keyboard theme in preference: " + themeIndex + ", default to "
+            Log.e(TAG, "Illegal keyboard theme in preference: " + themeIndexString + ", default to "
                     + defaultThemeIndex, e);
-            return Integer.valueOf(defaultThemeIndex);
+        }
+        return defaultThemeIndex;
+    }
+
+    private static int readDefaultKeyboardThemeIndex(final Resources res) {
+        final String defaultThemeIndexString = res.getString(
+                R.string.config_default_keyboard_theme_index);
+        try {
+            return Integer.parseInt(defaultThemeIndexString);
+        } catch (final NumberFormatException e) {
+            final int defaultThemeIndex = KeyboardSwitcher.DEFAULT_THEME_INDEX;
+            Log.e(TAG, "Corrupted default keyoard theme in resource: " + defaultThemeIndexString
+                    + ", default to " + defaultThemeIndex, e);
+            return defaultThemeIndex;
         }
     }
 
     public static int resetAndGetDefaultKeyboardThemeIndex(final SharedPreferences prefs,
             final Resources res) {
-        final String defaultThemeIndex = res.getString(
-                R.string.config_default_keyboard_theme_index);
-        prefs.edit().putString(PREF_KEYBOARD_LAYOUT, defaultThemeIndex).apply();
-        return Integer.valueOf(defaultThemeIndex);
+        final int defaultThemeIndex = readDefaultKeyboardThemeIndex(res);
+        prefs.edit().putString(PREF_KEYBOARD_LAYOUT, Integer.toString(defaultThemeIndex)).apply();
+        return defaultThemeIndex;
     }
 
     public static String readPrefAdditionalSubtypes(final SharedPreferences prefs,
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
index 50fbbb1..5a652a5 100644
--- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
@@ -285,7 +285,7 @@
         // When autoCorrectionThreshold is greater than 1.0, it's like auto correction is off.
         final float autoCorrectionThreshold;
         try {
-            final int arrayIndex = Integer.valueOf(currentAutoCorrectionSetting);
+            final int arrayIndex = Integer.parseInt(currentAutoCorrectionSetting);
             if (arrayIndex >= 0 && arrayIndex < autoCorrectionThresholdValues.length) {
                 final String val = autoCorrectionThresholdValues[arrayIndex];
                 if (FLOAT_MAX_VALUE_MARKER_STRING.equals(val)) {
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
index 0993c4b..a4c69e0 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
@@ -42,7 +42,7 @@
 @SmallTest
 public class KeyboardLayoutSetTestsBase extends AndroidTestCase {
     private static final KeyboardTheme DEFAULT_KEYBOARD_THEME =
-            KeyboardSwitcher.KEYBOARD_THEMES[KeyboardSwitcher.THEME_INDEX_DEFAULT];
+            KeyboardSwitcher.KEYBOARD_THEMES[KeyboardSwitcher.DEFAULT_THEME_INDEX];
 
     // All input method subtypes of LatinIME.
     private final ArrayList<InputMethodSubtype> mAllSubtypesList = CollectionUtils.newArrayList();
