diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c
index cd0b0bc..f19e5ba 100644
--- a/modules/prefer-plain/e-mail-parser-prefer-plain.c
+++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c
@@ -184,6 +184,7 @@ empe_prefer_plain_parse (EMailParserExtension *extension,
 	gboolean has_calendar = FALSE;
 	GSList *plain_text_parts, *iter;
 	GSList *plain_text_placeholder = NULL;
+	GSList *output_parts = NULL;
 
 	emp_pp = (EMailParserPreferPlain *) extension;
 
@@ -326,17 +327,27 @@ empe_prefer_plain_parse (EMailParserExtension *extension,
 	}
 
 	/* Replace the plain_text_placeholder by the actual plain_text_parts */
+	output_parts = NULL;
 	for (iter = parts; iter; iter = iter->next) {
-		if (iter && iter->next == plain_text_placeholder) {
-			break;
+		if (!iter) {
+		    continue;
+		}
+
+		if (iter != plain_text_placeholder) {
+		    output_parts = g_slist_append (output_parts, iter->data);
+		} else {
+		    output_parts = g_slist_concat (output_parts, plain_text_parts);
+		    break;
 		}
 	}
-	plain_text_parts = g_slist_concat (plain_text_parts, plain_text_placeholder);
-	parts = g_slist_concat (iter, plain_text_parts);
+	if (iter && iter->next) {
+	    output_parts = g_slist_concat (output_parts, g_slist_copy (iter->next));
+	}
+	g_slist_free (parts);
 
 	g_string_truncate (part_id, partidlen);
 
-	return parts;
+	return output_parts;
 }
 
 static const gchar **
