diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index cd4143e..93d5ef6 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1805,7 +1805,6 @@
         final int length = mComposing.length();
         if (!mHasValidSuggestions && length > 0) {
             final InputConnection ic = getCurrentInputConnection();
-            mHasValidSuggestions = true;
             mJustReverted = true;
             final CharSequence punctuation = ic.getTextBeforeCursor(1, 0);
             if (deleteChar) ic.deleteSurroundingText(1, 0);
@@ -1815,14 +1814,19 @@
                 toDelete--;
             }
             ic.deleteSurroundingText(toDelete, 0);
-            if (deleteChar) {
+            // Re-insert punctuation only when the deleted character was word separator and the
+            // composing text wasn't equal to the auto-corrected text.
+            if (deleteChar
+                    && !TextUtils.isEmpty(punctuation) && isWordSeparator(punctuation.charAt(0))
+                    && !TextUtils.equals(mComposing, toTheLeft)) {
                 ic.commitText(mComposing, 1);
                 TextEntryState.acceptedTyped(mComposing);
-                if (!TextUtils.isEmpty(punctuation) && isWordSeparator(punctuation.charAt(0))) {
-                    ic.commitText(punctuation, 1);
-                    TextEntryState.typedCharacter(punctuation.charAt(0), true);
-                }
+                ic.commitText(punctuation, 1);
+                TextEntryState.typedCharacter(punctuation.charAt(0), true);
+                // Clear composing text
+                mComposing.setLength(0);
             } else {
+                mHasValidSuggestions = true;
                 ic.setComposingText(mComposing, 1);
                 TextEntryState.backspace();
             }
