diff --git a/peas-demo/peas-demo-window.c b/peas-demo/peas-demo-window.c
index 35cc2cb..1caf1f1 100644
--- a/peas-demo/peas-demo-window.c
+++ b/peas-demo/peas-demo-window.c
@@ -47,7 +47,10 @@ on_extension_added (PeasExtensionSet *set,
                     PeasExtension    *exten,
                     DemoWindow       *dw)
 {
+  g_print ("Add1 Refcnt: %u\n", G_OBJECT(dw)->ref_count);
   peas_activatable_activate (PEAS_ACTIVATABLE (exten));
+  g_print ("Add2 Refcnt: %u\n", G_OBJECT(dw)->ref_count);
+
 }
 
 static void
@@ -56,7 +59,12 @@ on_extension_removed (PeasExtensionSet *set,
                       PeasExtension    *exten,
                       DemoWindow       *dw)
 {
+  g_print ("REMOVE1 Refcnt: %u\n", G_OBJECT(dw)->ref_count);
+
   peas_activatable_deactivate (PEAS_ACTIVATABLE (exten));
+  peas_engine_garbage_collect (dw->engine);
+  g_print ("REMOVE2 Refcnt: %u\n", G_OBJECT(dw)->ref_count);
+
 }
 
 static gboolean
@@ -65,7 +73,9 @@ on_delete_event (GtkWidget *window,
                  gpointer   user_data)
 {
   DemoWindow *dw = DEMO_WINDOW (window);
+  g_print ("DEL1 Refcnt: %u\n", G_OBJECT(window)->ref_count);
   peas_extension_set_call (dw->exten_set, "deactivate");
+  g_print ("DEL2 Refcnt: %u\n", G_OBJECT(window)->ref_count);
 
   return FALSE;
 }
@@ -89,12 +99,32 @@ demo_window_set_data (DemoWindow *dw,
 }
 
 static void
+demo_window_dispose (GObject *object)
+{
+  DemoWindow *dw = DEMO_WINDOW (object);
+
+  g_print ("PeasWindowDispose\n");
+  peas_engine_garbage_collect (dw->engine);
+
+  if (dw->exten_set) {
+    g_object_unref (dw->exten_set);
+    dw->exten_set = NULL;
+    peas_engine_garbage_collect (dw->engine);
+  }
+
+  G_OBJECT_CLASS (demo_window_parent_class)->dispose (object);
+}
+
+static void
 demo_window_finalize (GObject *object)
 {
   DemoWindow *dw = DEMO_WINDOW (object);
 
-  g_object_unref (dw->exten_set);
-  g_object_unref (dw->engine);
+  g_print ("PeasWindowFinalize\n");
+  if (dw->engine) {
+    g_object_unref (dw->engine);
+    dw->engine = NULL;
+  }
 
   G_OBJECT_CLASS (demo_window_parent_class)->finalize (object);
 }
@@ -104,6 +134,7 @@ demo_window_class_init (DemoWindowClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+  object_class->dispose = demo_window_dispose;
   object_class->finalize = demo_window_finalize;
 
   klass->n_windows = 0;
diff --git a/peas-demo/peas-demo.c b/peas-demo/peas-demo.c
index a97d91a..467768f 100644
--- a/peas-demo/peas-demo.c
+++ b/peas-demo/peas-demo.c
@@ -32,6 +32,7 @@
 gboolean run_from_build_dir;
 static GtkWidget *main_window;
 static int n_windows;
+GtkWidget *window;
 
 static GOptionEntry demo_args[] = {
   { "run-from-build-dir", 'b', 0, G_OPTION_ARG_NONE, &run_from_build_dir,
@@ -72,10 +73,12 @@ create_plugin_manager (GtkButton *button,
 static void
 create_new_window (void)
 {
-  GtkWidget *window;
+
 
   window = demo_window_new (peas_engine_get_default ());
   gtk_widget_show_all (window);
+  g_print ("WinNEW Refcnt: %u\n", G_OBJECT(window)->ref_count);
+
 }
 
 static GtkWidget *
@@ -171,6 +174,8 @@ main (int    argc,
 
   gtk_main ();
 
+  g_print ("Quit Refcnt: %u\n", G_OBJECT(window)->ref_count);
+
   g_object_unref (engine);
 
   return 0;
