diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index 3eb135e..948fe5a 100644
--- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -197,8 +197,14 @@
     void setKeyboardMode(int mode, int imeOptions, boolean enableVoice) {
         mSymbolsModeState = SYMBOLS_MODE_STATE_NONE;
         mPreferSymbols = mode == MODE_SYMBOLS;
-        setKeyboardMode(mode == MODE_SYMBOLS ? MODE_TEXT : mode, imeOptions, enableVoice,
-                mPreferSymbols);
+        if (mode == MODE_SYMBOLS) {
+            mode = MODE_TEXT;
+        }
+        try {
+            setKeyboardMode(mode, imeOptions, enableVoice, mPreferSymbols);
+        } catch (RuntimeException e) {
+            LatinImeLogger.logOnException(mode + "," + imeOptions + "," + mPreferSymbols, e);
+        }
     }
 
     void setKeyboardMode(int mode, int imeOptions, boolean enableVoice, boolean isSymbols) {
@@ -213,11 +219,7 @@
         mInputView.setPreviewEnabled(true);
         KeyboardId id = getKeyboardId(mode, imeOptions, isSymbols);
         LatinKeyboard keyboard = null;
-        try {
-            keyboard = getKeyboard(id);
-        } catch (RuntimeException e) {
-            LatinImeLogger.logOnException(mode + "," + imeOptions + "," + isSymbols, e);
-        }
+        keyboard = getKeyboard(id);
 
         if (mode == MODE_PHONE) {
             mInputView.setPhoneKeyboard(keyboard);
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 46fca37..edc2e08 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -275,6 +275,7 @@
     };
 
     @Override public void onCreate() {
+        LatinImeLogger.init(this);
         super.onCreate();
         //setStatusIcon(R.drawable.ime_qwerty);
         mResources = getResources();
@@ -311,7 +312,6 @@
               });
         }
         prefs.registerOnSharedPreferenceChangeListener(this);
-        LatinImeLogger.init(this);
     }
 
     private void initSuggest(String locale) {
diff --git a/java/src/com/android/inputmethod/latin/LatinImeLogger.java b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
index 7ad0ec6..4742810 100644
--- a/java/src/com/android/inputmethod/latin/LatinImeLogger.java
+++ b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
@@ -39,7 +39,7 @@
     private static final boolean DBG = true;
     private static boolean sLOGPRINT = false;
     // SUPPRESS_EXCEPTION should be true when released to public.
-    private static final boolean SUPPRESS_EXCEPTION = false;
+    private static final boolean SUPPRESS_EXCEPTION = true;
     // DEFAULT_LOG_ENABLED should be false when released to public.
     private static final boolean DEFAULT_LOG_ENABLED = true;
 
@@ -48,6 +48,8 @@
     private static final long MINIMUMSENDSIZE = 40;
     private static final char SEPARATER = ';';
     private static final char NULL_CHAR = '\uFFFC';
+    private static final int EXCEPTION_MAX_LENGTH = 400;
+
     private static final int ID_MANUALSUGGESTION = 0;
     private static final int ID_AUTOSUGGESTIONCANCELLED = 1;
     private static final int ID_AUTOSUGGESTION = 2;
@@ -368,7 +370,9 @@
     }
 
     private void commitInternalAndStopSelf() {
-        Log.e(TAG, "Exception was caused and let's die.");
+        if (DBG) {
+            Log.e(TAG, "Exception was thrown and let's die.");
+        }
         commitInternal();
         LatinIME ime = ((LatinIME) mContext);
         ime.hideWindow();
@@ -539,10 +543,13 @@
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             PrintStream ps = new PrintStream(baos);
             e.printStackTrace(ps);
-            String exceptionString = new String(baos.toByteArray());
+            String exceptionString = new String(baos.toByteArray(), 0,
+                    Math.min(EXCEPTION_MAX_LENGTH, baos.size()));
             sLatinImeLogger.sendLogToDropBox(
                     ID_EXCEPTION, new String[] {metaData, exceptionString});
-            Log.e(TAG, "Exception: " + exceptionString);
+            if (DBG) {
+                Log.e(TAG, "Exception: " + new String(baos.toByteArray()));
+            }
             if (SUPPRESS_EXCEPTION) {
                 sLatinImeLogger.commitInternalAndStopSelf();
             } else {
