diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index a8c7f03..816a95c 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -2324,6 +2324,9 @@ imapx_untagged_bye (CamelIMAPXServer *is,
 			error, CAMEL_IMAPX_ERROR, 1,
 			"IMAP server said BYE: %s", token);
 	}
+
+	g_free (token);
+
 	is->state = IMAPX_SHUTDOWN;
 
 	return FALSE;
diff --git a/camel/camel-imapx-summary.c b/camel/camel-imapx-summary.c
index 0656380..c0042c7 100644
--- a/camel/camel-imapx-summary.c
+++ b/camel/camel-imapx-summary.c
@@ -63,6 +63,11 @@ imapx_message_info_clone (CamelFolderSummary *s,
 
 	to = (CamelIMAPXMessageInfo *)
 		folder_summary_class->message_info_clone (s, mi);
+	if (from->server_user_flags) {
+		CamelIMAPXMessageInfo *xfrom = (CamelIMAPXMessageInfo *) from;
+
+		camel_flag_list_copy (&to->server_user_flags, &xfrom->server_user_flags);
+	}
 	to->server_flags = from->server_flags;
 
 	/* FIXME: parent clone should do this */
@@ -72,6 +77,17 @@ imapx_message_info_clone (CamelFolderSummary *s,
 }
 
 static void
+imapx_message_info_free (CamelFolderSummary *summary,
+			 CamelMessageInfo *mi)
+{
+	CamelIMAPXMessageInfo *xinfo = (CamelIMAPXMessageInfo *) mi;
+
+	camel_flag_list_free (&xinfo->server_user_flags);
+
+	CAMEL_FOLDER_SUMMARY_CLASS (camel_imapx_summary_parent_class)->message_info_free (summary, mi);
+}
+
+static void
 camel_imapx_summary_class_init (CamelIMAPXSummaryClass *class)
 {
 	CamelFolderSummaryClass *folder_summary_class;
@@ -80,6 +96,7 @@ camel_imapx_summary_class_init (CamelIMAPXSummaryClass *class)
 	folder_summary_class->message_info_size = sizeof (CamelIMAPXMessageInfo);
 	folder_summary_class->content_info_size = sizeof (CamelIMAPXMessageContentInfo);
 	folder_summary_class->message_info_clone = imapx_message_info_clone;
+	folder_summary_class->message_info_free = imapx_message_info_free;
 	folder_summary_class->summary_header_to_db = summary_header_to_db;
 	folder_summary_class->summary_header_from_db = summary_header_from_db;
 	folder_summary_class->message_info_to_db = message_info_to_db;
