diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index e0b736f..7e5938a 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -1818,7 +1818,7 @@ gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard)
 /**
  * gtk_clipboard_wait_for_targets:
  * @clipboard: a #GtkClipboard
- * @targets: (out) (array length=n_targets) (transfer container): location
+ * @targets: (out) (array length=n_targets) (transfer container)  (element-type GdkAtom): location
  *           to store an array of targets. The result stored here must
  *           be freed with g_free().
  * @n_targets: location to store number of items in @targets.
@@ -1839,6 +1839,7 @@ gtk_clipboard_wait_for_targets (GtkClipboard  *clipboard,
 				GdkAtom      **targets,
 				gint          *n_targets)
 {
+  g_printerr("gtk_clipboard_wait_for_targets / stars\n");
   GtkSelectionData *data;
   gboolean result = FALSE;
   
@@ -1848,9 +1849,13 @@ gtk_clipboard_wait_for_targets (GtkClipboard  *clipboard,
   if (gdk_display_supports_selection_notification (gtk_clipboard_get_display (clipboard)) &&
       clipboard->n_cached_targets != -1)
     {
-      if (n_targets)
- 	*n_targets = clipboard->n_cached_targets;
- 
+      g_printerr("gtk_clipboard_wait_for_targets / cached targets\n");
+
+      if (n_targets) {
+            *n_targets = clipboard->n_cached_targets;
+            g_printerr("n_targets (1) %d\n", n_targets);
+      } 
+
       if (targets)
  	*targets = g_memdup (clipboard->cached_targets,
  			     clipboard->n_cached_targets * sizeof (GdkAtom));
@@ -1858,9 +1863,11 @@ gtk_clipboard_wait_for_targets (GtkClipboard  *clipboard,
        return TRUE;
     }
   
-  if (n_targets)
+  if (n_targets) {
     *n_targets = 0;
-      
+     g_printerr("clean n_targets %d\n", *n_targets);
+  }
+
   if (targets)
     *targets = NULL;      
 
@@ -1868,26 +1875,45 @@ gtk_clipboard_wait_for_targets (GtkClipboard  *clipboard,
 
   if (data)
     {
+      g_printerr("gtk_clipboard_wait_for_targets / data = True\n");
       GdkAtom *tmp_targets;
       gint tmp_n_targets;
        
       result = gtk_selection_data_get_targets (data, &tmp_targets, &tmp_n_targets);
+      g_printerr("tmp_n_targets (2) %d\n", tmp_n_targets);
+	    int i;
+	    for (i = 0; i < tmp_n_targets; i++) {
+                g_printerr("Atom name (tmp): %s\n", gdk_atom_name(tmp_targets[i]));
+        }
  
       if (gdk_display_supports_selection_notification (gtk_clipboard_get_display (clipboard)))
  	{
+      g_printerr("gtk_clipboard_wait_for_targets / gdk_display_supports_selection_notification\n");
  	  clipboard->n_cached_targets = tmp_n_targets;
  	  clipboard->cached_targets = g_memdup (tmp_targets,
  						tmp_n_targets * sizeof (GdkAtom));
  	}
  
-      if (n_targets)
+      if (n_targets) {
  	*n_targets = tmp_n_targets;
+          g_printerr("tmp_n_target -> n_targets \n");
  
-      if (targets)
+      }
+      if (targets) {
  	*targets = tmp_targets;
-      else
+          g_printerr("tmp_target -> targets \n");
+     } else
  	g_free (tmp_targets);
       
+      g_printerr("n_targets (3) %d\n", *n_targets);
+
+        GdkAtom *target;
+        target = *targets;
+
+	    for (i = 0; i < *n_targets; i++) {
+                g_printerr("Atom name: %s\n", gdk_atom_name(*target++));
+        }
+
       gtk_selection_data_free (data);
     }
 
