diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 6fecd6a..541d000 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -3374,7 +3374,9 @@ message_info_free(CamelFolderSummary *s, CamelMessageInfo *info)
 	CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
 	
 	if (mi->uid) {
-		g_hash_table_remove (s->loaded_infos, mi->uid);
+		if (g_hash_table_lookup (s->loaded_infos, mi->uid) == mi) {
+			g_hash_table_remove (s->loaded_infos, mi->uid);
+		}
 		camel_pstring_free(mi->uid);
 	} 
 	camel_pstring_free(mi->subject);
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 8645b8c..d37a9f3 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -46,6 +46,7 @@
 #include "camel-vee-summary.h"
 #include "camel-string-utils.h"
 #include "camel-vee-folder.h"
+#include "camel-vtrash-folder.h"
 
 #define d(x) 
 #define dd(x) (camel_debug("vfolder")?(x):0)
@@ -1115,8 +1116,14 @@ vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
 
 	camel_vee_folder_hash_folder(source, u.hash);
 	shash = g_strdup_printf("%c%c%c%c%c%c%c%c", u.hash[0], u.hash[1], u.hash[2], u.hash[3], u.hash[4], u.hash[5], u.hash[6], u.hash[7]);	
-	if (!g_hash_table_lookup (vf->hashes, shash))
+	if (!g_hash_table_lookup (vf->hashes, shash)) {
+		if (!CAMEL_IS_VTRASH_FOLDER (vf))
+			printf ("%s: hash '%s' for %p '%s'\n", __FUNCTION__, shash, source->summary, source->full_name);
 		g_hash_table_insert (vf->hashes, g_strdup(shash), source->summary);
+	}
+	if (folder_unmatched && !g_hash_table_lookup (folder_unmatched->hashes, shash)) {
+		g_hash_table_insert (folder_unmatched->hashes, g_strdup (shash), source->summary);
+	}
 
 	/* if we have no expression, or its been cleared, then act as if no matches */
 	if (vf->expression == NULL) {
@@ -1917,12 +1924,20 @@ static void
 vee_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
 {
 	char *shash, hash[8];
+	CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
 
 	camel_vee_folder_hash_folder(sub, hash);	
 	vee_folder_remove_folder(vf, sub);
 	shash = g_strdup_printf("%c%c%c%c%c%c%c%c", hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7]);
-	if (g_hash_table_lookup (vf->hashes, shash))
+	if (g_hash_table_lookup (vf->hashes, shash)) {
+		if (!CAMEL_IS_VTRASH_FOLDER (vf))
+			printf ("%s: hash '%s' for %p '%s'\n", __FUNCTION__, shash, sub->summary, sub->full_name);
 		g_hash_table_remove (vf->hashes, shash);
+	}
+
+	if (folder_unmatched && g_hash_table_lookup (folder_unmatched->hashes, shash)) {
+		g_hash_table_remove (folder_unmatched->hashes, shash);
+	}
 
 	g_free(shash);
 
diff --git a/camel/camel-vee-summary.c b/camel/camel-vee-summary.c
index 5a02fb3..205f05f 100644
--- a/camel/camel-vee-summary.c
+++ b/camel/camel-vee-summary.c
@@ -336,14 +336,13 @@ message_info_from_uid (CamelFolderSummary *s, const char *uid)
 	/* FIXME[disk-summary] too bad design. Need to peek it from cfs
 	 * instead of hacking ugly like this */
 	CAMEL_SUMMARY_LOCK(s, summary_lock);
-	CAMEL_SUMMARY_LOCK(s, ref_lock);
 
 	info = g_hash_table_lookup (s->loaded_infos, uid);
 
-	if (info)
-		info->refcount++;
+	if (info) {
+		camel_message_info_ref (info);
+	}
 
-	CAMEL_SUMMARY_UNLOCK(s, ref_lock);
 	CAMEL_SUMMARY_UNLOCK(s, summary_lock);
 	
 	if (!info) {
@@ -369,7 +368,15 @@ message_info_from_uid (CamelFolderSummary *s, const char *uid)
 		strncpy(tmphash, uid, 8);
 		tmphash[8] = 0;
 		vinfo->summary = g_hash_table_lookup(((CamelVeeFolder *) s->folder)->hashes, tmphash);
-		camel_object_ref (vinfo->summary);
+		if (!vinfo->summary) {
+			static int t = 50;
+			if (t >= 0) {
+				printf ("%s: didn't find summary for hash '%s', folder '%s'; uid: '%s' (known:%d)\n", __FUNCTION__, tmphash, s->folder->full_name, uid, g_hash_table_size (((CamelVeeFolder *) s->folder)->hashes));
+				t--;
+			}
+		} else {
+			camel_object_ref (vinfo->summary);
+		}
 		camel_folder_summary_insert (s, info, FALSE);
 	}
 	return info;	
@@ -498,6 +505,7 @@ camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const cha
 			camel_object_ref(summary);
 		}
 
+		camel_message_info_ref (mi);
 		return mi;
 	}
 
