diff --git a/plugins/language-support-cpp-java/plugin.c b/plugins/language-support-cpp-java/plugin.c
index 76dac50..0f0a242 100644
--- a/plugins/language-support-cpp-java/plugin.c
+++ b/plugins/language-support-cpp-java/plugin.c
@@ -603,8 +603,8 @@ language_support_get_mark_position (IAnjutaEditor* editor, gchar* mark)
 										ianjuta_editor_get_start_position(editor, NULL));
 	IAnjutaEditorCell *search_end = IANJUTA_EDITOR_CELL (
 										ianjuta_editor_get_end_position(editor, NULL));
-	IAnjutaEditorCell *result_start;
-	IAnjutaEditorCell *result_end;
+	IAnjutaEditorCell *result_start = NULL;
+	IAnjutaEditorCell *result_end = NULL;
 
 	ianjuta_editor_search_forward (IANJUTA_EDITOR_SEARCH (editor),
 								   mark, FALSE,
@@ -612,7 +612,8 @@ language_support_get_mark_position (IAnjutaEditor* editor, gchar* mark)
 								   &result_start,
 								   &result_end, NULL);
 
-	g_object_unref (result_start);
+	if (result_start)
+		g_object_unref (result_start);
 
 	return IANJUTA_ITERABLE (result_end);
 }
@@ -817,47 +818,132 @@ on_glade_drop (IAnjutaEditor* editor,
 
 static gchar* generate_widget_member_decl_str(gchar *widget_name)
 {
-       return g_strdup_printf ("\n\tGtkWidget* %s;", widget_name);
+	return g_strdup_printf ("\n\tGtkWidget* %s;", widget_name);
 }
 
 static gchar *generate_widget_member_init_str(gchar *widget_name)
 {
-       return g_strdup_printf ("\n\tpriv->%s = GTK_WIDGET ("
-                               "gtk_builder_get_object(builder, \"%s\"));", widget_name, widget_name);
+	return g_strdup_printf ("\n\tpriv->%s = GTK_WIDGET ("
+	                        "gtk_builder_get_object(builder, \"%s\"));", widget_name, widget_name);
 }
 
 static gboolean insert_after_mark (IAnjutaEditor* editor, gchar* mark,
-gchar* code_to_add)
+                                   gchar* code_to_add, CppJavaPlugin *lang_plugin)
 {
-       IAnjutaIterable* mark_position;
-       mark_position = language_support_get_mark_position (editor, mark);
-       if(!mark_position)
+	IAnjutaIterable* mark_position;
+	mark_position = language_support_get_mark_position (editor, mark);
+	if(!mark_position)
 		return FALSE;
 
-       ianjuta_editor_insert (editor, mark_position, code_to_add, -1, NULL);
+	ianjuta_editor_insert (editor, mark_position, code_to_add, -1, NULL);
+	int line = ianjuta_editor_get_line_from_position (editor, mark_position, NULL);
+	const gchar *filename = ianjuta_document_get_filename (IANJUTA_DOCUMENT (editor), NULL);
 
-       /* Emit code-added signal, so symbols will be updated */
-       g_signal_emit_by_name (G_OBJECT (editor), "code-added", mark_position, code_to_add);
-       g_object_unref (mark_position);
 
-       return TRUE;
+	IAnjutaSymbolManager *symbol_manager =
+		anjuta_shell_get_interface (ANJUTA_PLUGIN (lang_plugin)->shell, IAnjutaSymbolManager, NULL);
+	IAnjutaSymbolQuery *query_scope =
+		ianjuta_symbol_manager_create_query (symbol_manager,
+		                                     IANJUTA_SYMBOL_QUERY_SEARCH_SCOPE,
+		                                     IANJUTA_SYMBOL_QUERY_DB_PROJECT, NULL);
+	IAnjutaSymbolField fields[] = 
+	{
+		IANJUTA_SYMBOL_FIELD_ID,		
+		IANJUTA_SYMBOL_FIELD_NAME,
+		IANJUTA_SYMBOL_FIELD_IS_CONTAINER,
+		IANJUTA_SYMBOL_FIELD_TYPE_NAME
+	};
+	ianjuta_symbol_query_set_fields(query_scope, 4, fields, NULL);
+
+
+
+	if (query_scope) 
+		printf("Query creation sucessful!\n");
+
+	printf ("Inserting in line %d in file %s.\n", line, filename);
+
+	printf ("Trying to get scope...\n");
+	GFile *file = ianjuta_file_get_file (IANJUTA_FILE(editor), NULL);
+	gchar* path = g_file_get_path (file);
+	printf ("File complete path is %s.\n", path);
+	IAnjutaIterable* scope =
+		ianjuta_symbol_query_search_scope (query_scope,
+		                                   path,
+		                                   line,
+		                                   NULL);
+
+	if (!scope)
+		return FALSE;
+	do
+	{
+		printf ("Scope found!\n");
+		const gchar* symbol_name;
+		symbol_name = ianjuta_symbol_get_string (IANJUTA_SYMBOL(scope),
+		                                         IANJUTA_SYMBOL_FIELD_NAME,
+		                                         NULL);
+		printf ("Scope: %s.\n", symbol_name);
+		printf ("Is container: %d\n", ianjuta_symbol_get_int(IANJUTA_SYMBOL(scope),
+		                                                       IANJUTA_SYMBOL_FIELD_IS_CONTAINER,
+		                                                       NULL));
+		printf ("Type name: %s\n", ianjuta_symbol_get_string (IANJUTA_SYMBOL(scope),
+		                                                    IANJUTA_SYMBOL_FIELD_TYPE_NAME,
+		                                                    NULL));
+		
+
+		printf ("Preparing members query...\n");
+
+		IAnjutaSymbolQuery *query_members =
+			ianjuta_symbol_manager_create_query (symbol_manager,
+			                                     IANJUTA_SYMBOL_QUERY_SEARCH_MEMBERS,
+			                                     IANJUTA_SYMBOL_QUERY_DB_PROJECT,
+			                                     NULL);
+
+
+		if (query_members) 
+		{
+			printf ("Members query creation sucessful!\n");
+			printf ("Querying...\n");
+			IAnjutaIterable *members =
+				ianjuta_symbol_query_search_members (query_members, IANJUTA_SYMBOL(scope), NULL);
+			printf ("Querying finished\n");
+			if (members) 
+			{
+				printf ("Members found!\n");
+				do {
+					IAnjutaSymbol *symbol = IANJUTA_SYMBOL (members);
+					printf ("%s\n", ianjuta_symbol_get_string (symbol,
+					                                           IANJUTA_SYMBOL_FIELD_NAME, NULL));
+				}
+				while (ianjuta_iterable_next (members, NULL));
+			} 
+			else 
+				printf ("No members found :(\n");
+		}
+	}
+	while (ianjuta_iterable_next(scope, NULL));
+
+	/* Emit code-added signal, so symbols will be updated */
+	g_signal_emit_by_name (G_OBJECT (editor), "code-added", mark_position, code_to_add);
+	g_object_unref (mark_position);
+
+	return TRUE;
 }
 
 static void insert_member_decl_and_init (IAnjutaEditor* editor, gchar* widget_name,
                                          CppJavaPlugin *lang_plugin)
 {
-       AnjutaStatus* status;
-       gchar* member_decl = generate_widget_member_decl_str(widget_name);
-       gchar* member_init = generate_widget_member_init_str(widget_name);
+	AnjutaStatus* status;
+	gchar* member_decl = generate_widget_member_decl_str(widget_name);
+	gchar* member_init = generate_widget_member_init_str(widget_name);
 
-       status = anjuta_shell_get_status (ANJUTA_PLUGIN (lang_plugin)->shell, NULL);
+	status = anjuta_shell_get_status (ANJUTA_PLUGIN (lang_plugin)->shell, NULL);
 
-       if(insert_after_mark (editor, "/* ANJUTA: Widgets declaration - DO NOT REMOVE */", member_decl) &&
-          insert_after_mark (editor, "/* ANJUTA: Widgets initialization - DO NOT REMOVE */", member_init))
-              anjuta_status_set (status, _("Code added for widget."));
+	if(insert_after_mark (editor, "/* ANJUTA: Widgets declaration - DO NOT REMOVE */", member_decl, lang_plugin) &&
+	   insert_after_mark (editor, "/* ANJUTA: Widgets initialization - DO NOT REMOVE */", member_init, lang_plugin))
+		anjuta_status_set (status, _("Code added for widget."));
 
-       g_free (member_decl);
-       g_free (member_init);
+	g_free (member_decl);
+	g_free (member_init);
 }
 
 static void
@@ -1043,7 +1129,7 @@ on_value_removed_current_editor (AnjutaPlugin *plugin, const gchar *name,
 static void
 on_swap_activate (GtkAction* action, gpointer data)
 {
-	GFile* file;
+	GFile* file;	
 	CppJavaPlugin *lang_plugin = ANJUTA_PLUGIN_CPP_JAVA (data);
 	IAnjutaDocumentManager* docman =
 		anjuta_shell_get_interface (ANJUTA_PLUGIN(lang_plugin)->shell,
diff --git a/plugins/symbol-db/symbol-db-query.c b/plugins/symbol-db/symbol-db-query.c
index 8346fd1..4f10bad 100644
--- a/plugins/symbol-db/symbol-db-query.c
+++ b/plugins/symbol-db/symbol-db-query.c
@@ -530,6 +530,9 @@ sdb_query_execute_real (SymbolDBQuery *query)
 	else if (!priv->stmt)
 		priv->stmt = symbol_db_engine_get_statement (priv->dbe_selected,
 		                                             priv->sql_stmt);
+
+	g_printf("SQL: %s", gda_statement_to_sql (priv->stmt, priv->params, NULL));
+	
 	data_model = symbol_db_engine_execute_select (priv->dbe_selected,
 	                                              priv->stmt,
 	                                              priv->params);
