diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java
index 0aed506..d35948b 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java
@@ -59,6 +59,14 @@
     private final Params mParams;
     private final KeysCache mKeysCache = new KeysCache();
 
+    public static class KeyboardSetException extends RuntimeException {
+        public final KeyboardId mKeyboardId;
+        public KeyboardSetException(Throwable cause, KeyboardId keyboardId) {
+            super(cause);
+            mKeyboardId = keyboardId;
+        }
+    }
+
     public static class KeysCache {
         private final Map<Key, Key> mMap;
 
@@ -107,11 +115,6 @@
         mParams = params;
     }
 
-    // TODO: Remove this method, use {@link #getKeyboard} directly.
-    public Keyboard getMainKeyboard() {
-        return getKeyboard(KeyboardId.ELEMENT_ALPHABET);
-    }
-
     public Keyboard getKeyboard(int baseKeyboardSetElementId) {
         final int keyboardSetElementId;
         switch (mParams.mMode) {
@@ -134,8 +137,11 @@
                     KeyboardId.ELEMENT_ALPHABET);
         }
         final KeyboardId id = getKeyboardId(keyboardSetElementId);
-        final Keyboard keyboard = getKeyboard(mContext, keyboardXmlId, id);
-        return keyboard;
+        try {
+            return getKeyboard(mContext, keyboardXmlId, id);
+        } catch (RuntimeException e) {
+            throw new KeyboardSetException(e, id);
+        }
     }
 
     private Keyboard getKeyboard(Context context, int keyboardXmlId, KeyboardId id) {
@@ -169,11 +175,10 @@
         return keyboard;
     }
 
-    // TODO: Make this method private.
     // Note: The keyboard for each locale, shift state, and mode are represented as KeyboardSet
     // element id that is a key in keyboard_set.xml.  Also that file specifies which XML layout
     // should be used for each keyboard.  The KeyboardId is an internal key for Keyboard object.
-    public KeyboardId getKeyboardId(int keyboardSetElementId) {
+    private KeyboardId getKeyboardId(int keyboardSetElementId) {
         final Params params = mParams;
         final boolean isSymbols = (keyboardSetElementId == KeyboardId.ELEMENT_SYMBOLS
                 || keyboardSetElementId == KeyboardId.ELEMENT_SYMBOLS_SHIFTED);
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index d5ea76a..df7296b 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -27,6 +27,7 @@
 import android.view.inputmethod.EditorInfo;
 
 import com.android.inputmethod.accessibility.AccessibleKeyboardViewProxy;
+import com.android.inputmethod.keyboard.KeyboardSet.KeyboardSetException;
 import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
 import com.android.inputmethod.keyboard.internal.KeyboardState;
 import com.android.inputmethod.latin.DebugSettings;
@@ -138,11 +139,9 @@
         mKeyboardSet = builder.build();
         try {
             mState.onLoadKeyboard(mResources.getString(R.string.layout_switch_back_symbols));
-        } catch (RuntimeException e) {
-            Log.w(TAG, "loading keyboard failed: " + mKeyboardSet.getKeyboardId(
-                    KeyboardId.ELEMENT_ALPHABET), e);
-            LatinImeLogger.logOnException(mKeyboardSet.getKeyboardId(
-                    KeyboardId.ELEMENT_ALPHABET).toString(), e);
+        } catch (KeyboardSetException e) {
+            Log.w(TAG, "loading keyboard failed: " + e.mKeyboardId, e.getCause());
+            LatinImeLogger.logOnException(e.mKeyboardId.toString(), e.getCause());
             return;
         }
     }
diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java
index 2e36245..0c023bd 100644
--- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java
+++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java
@@ -21,6 +21,7 @@
 
 import com.android.inputmethod.keyboard.KeyDetector;
 import com.android.inputmethod.keyboard.Keyboard;
+import com.android.inputmethod.keyboard.KeyboardId;
 import com.android.inputmethod.keyboard.KeyboardSet;
 
 import java.io.File;
@@ -35,22 +36,20 @@
     public SuggestHelper(Context context, int dictionaryId, KeyboardSet keyboardSet) {
         // Use null as the locale for Suggest so as to force it to use the internal dictionary
         // (and not try to find a dictionary provider for a specified locale)
-        mSuggest = new Suggest(context, dictionaryId, null);
-        mKeyboard = keyboardSet.getMainKeyboard();
-        mKeyDetector = new KeyDetector(0);
-        init();
+        this(new Suggest(context, dictionaryId, null), keyboardSet);
     }
 
     protected SuggestHelper(final Context context, final File dictionaryPath,
             final long startOffset, final long length, final KeyboardSet keyboardSet,
             final Locale locale) {
-        mSuggest = new Suggest(context, dictionaryPath, startOffset, length, null, locale);
-        mKeyboard = keyboardSet.getMainKeyboard();
-        mKeyDetector = new KeyDetector(0);
-        init();
+        this(new Suggest(context, dictionaryPath, startOffset, length, null, locale), keyboardSet);
     }
 
-    private void init() {
+    private SuggestHelper(final Suggest suggest, final KeyboardSet keyboardSet) {
+        mSuggest = suggest;
+        mKeyboard = keyboardSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET);
+        mKeyDetector = new KeyDetector(0);
+
         setCorrectionMode(Suggest.CORRECTION_FULL);
         mKeyDetector.setKeyboard(mKeyboard, 0, 0);
         mKeyDetector.setProximityCorrectionEnabled(true);
