 -        g_ptr_array_add (ids, id_dbt.data);
 +        gchar *tmp;
 +        for (tmp = id_dbt.data; tmp; tmp += strlen (tmp) + 1) {
-+          g_debug (G_STRLOC ": index query found: %s", (gchar *)tmp);
 +          g_ptr_array_add (ids, tmp);
  
 -        /* we add it to the list of strings to be freed */

       }
     }
 
@@ -637,17 +658,58 @@ enum 
   ORDER_LASTFIRST
 };
 

+    gchar *tmp;
+    for (tmp = id_dbt.data; tmp && strlen (tmp); tmp += strlen (tmp) + 1) {
+      gchar *data;
+      /* if the id is the one we're lookin for then delete! */
+      if (g_str_equal (tmp, uid)) {
+
+        /* Remove current str from data */
+        db_error = dbc->c_del (dbc, 0);
