diff --git a/codenav/src/switch_head_impl.c b/codenav/src/switch_head_impl.c
index 01f671f..6de2197 100644
--- a/codenav/src/switch_head_impl.c
+++ b/codenav/src/switch_head_impl.c
@@ -219,7 +219,7 @@ menu_item_activate(guint key_id)
 	GSList* iter_lang = NULL;
 	GSList* iter_ext = NULL;
 	GSList* iter_filename = NULL;
-	gint i=0;
+	guint i=0;
 
 	gchar* dirname = NULL;
 	gchar* basename = NULL;
@@ -570,7 +570,7 @@ static void
 on_configure_cell_edited(GtkCellRendererText* text, gchar* arg1, gchar* arg2, gpointer data)
 {
 	/* TODO !! */
-	Column col = (Column)(GPOINTER_TO_INT(data));
+	/* Column col = (Column)(GPOINTER_TO_INT(data)); */
 	log_debug("arg1 == %s, arg2 == %s\n", arg1, arg2);
 }
 
diff --git a/geanyprj/src/sidebar.c b/geanyprj/src/sidebar.c
index 60c084c..aacb9f4 100644
--- a/geanyprj/src/sidebar.c
+++ b/geanyprj/src/sidebar.c
@@ -307,7 +307,7 @@ static void prepare_file_view(void)
 {
 	GtkCellRenderer *text_renderer;
 	GtkTreeViewColumn *column;
-	GtkTreeSelection *select;
+	GtkTreeSelection *selection;
 	PangoFontDescription *pfd;
 
 	file_store = gtk_list_store_new(FILEVIEW_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
@@ -330,8 +330,8 @@ static void prepare_file_view(void)
 	pango_font_description_free(pfd);
 
 	/* selection handling */
-	select = gtk_tree_view_get_selection(GTK_TREE_VIEW(file_view));
-	gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE);
+	selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(file_view));
+	gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
 
 	g_signal_connect(G_OBJECT(file_view), "button-release-event",
 			 G_CALLBACK(on_button_release), NULL);
@@ -347,7 +347,7 @@ static void sidebar_clear(void)
 	gtk_list_store_clear(file_store);
 }
 
-
+#if 0
 static gint mycmp(const gchar *a, const gchar *b)
 {
 	const gchar *p1 = a;
@@ -395,7 +395,7 @@ static gint mycmp(const gchar *a, const gchar *b)
 		return 1;
 	return -1;
 }
-
+#endif
 
 static void add_item(gpointer name, G_GNUC_UNUSED gpointer value, gpointer user_data)
 {
diff --git a/gproject/src/gproject-main.c b/gproject/src/gproject-main.c
index 72f381f..008ce8f 100644
--- a/gproject/src/gproject-main.c
+++ b/gproject/src/gproject-main.c
@@ -91,7 +91,7 @@ static void on_doc_close(G_GNUC_UNUSED GObject * obj, GeanyDocument * doc,
 
 static void on_build_start(GObject *obj, gpointer user_data)
 {
-	gint i;
+	guint i;
 
 	foreach_document(i)
 	{
diff --git a/gproject/src/gproject-menu.c b/gproject/src/gproject-menu.c
index 658c1dc..03a5fe8 100644
--- a/gproject/src/gproject-menu.c
+++ b/gproject/src/gproject-menu.c
@@ -122,7 +122,7 @@ static void on_swap_header_source(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_U
 	{
 		gboolean swapped;
 		GSList *elem, *list = NULL;
-		gint i;
+		guint i;
 
 		foreach_document(i)
 		{
diff --git a/treebrowser/src/treebrowser.c b/treebrowser/src/treebrowser.c
index 7f20297..ab435fe 100644
--- a/treebrowser/src/treebrowser.c
+++ b/treebrowser/src/treebrowser.c
@@ -59,9 +59,9 @@ static gboolean 			flag_on_expand_refresh 		= FALSE;
 
 static gchar 				*CONFIG_FILE 				= NULL;
 #ifdef G_OS_WIN32
-static gchar 				*CONFIG_OPEN_EXTERNAL_CMD 	= "nautilus '%d'";
+static const gchar 		*CONFIG_OPEN_EXTERNAL_CMD 	= "nautilus '%d'";
 #else
-static gchar 				*CONFIG_OPEN_EXTERNAL_CMD 	= "explorer '%d'";
+static const gchar		 	*CONFIG_OPEN_EXTERNAL_CMD 	= "explorer '%d'";
 #endif
 static gboolean 			CONFIG_REVERSE_FILTER 		= FALSE;
 static gboolean 			CONFIG_ONE_CLICK_CHDOC 		= FALSE;
@@ -235,7 +235,7 @@ utils_pixbuf_from_path(gchar *path)
 static gchar*
 path_is_in_dir(gchar* src, gchar* find)
 {
-	int i = 0;
+	guint i = 0;
 
 	gchar *diffed_path = NULL, *tmp = NULL;
 	gchar **src_segments = NULL, **find_segments = NULL;
@@ -444,15 +444,18 @@ treebrowser_chroot(gchar *directory)
 	gtk_entry_set_text(GTK_ENTRY(addressbar), directory);
 
 	if (!directory || strlen(directory) == 0)
-		directory = G_DIR_SEPARATOR_S;
+		directory = g_strdup(G_DIR_SEPARATOR_S);
 
 	if (! treebrowser_checkdir(directory))
+	{
+		g_free(directory);
 		return;
+	}
 
 	treebrowser_bookmarks_set_state();
 
 	gtk_tree_store_clear(treestore);
-	setptr(addressbar_last_address, g_strdup(directory));
+	setptr(addressbar_last_address, directory);
 
 	treebrowser_browse(addressbar_last_address, NULL);
 	treebrowser_load_bookmarks();
@@ -795,7 +798,7 @@ gtk_tree_store_iter_clear_nodes(gpointer iter, gboolean delete_root)
 static gboolean
 treebrowser_expand_to_path(gchar* root, gchar* find)
 {
-	int i = 0;
+	guint i = 0;
 	gboolean founded = FALSE, global_founded = FALSE;
 	gchar *new = NULL;
 	gchar **root_segments = NULL, **find_segments = NULL;
@@ -1151,7 +1154,7 @@ static void
 on_menu_close_children(GtkMenuItem *menuitem, gchar *uri)
 {
 	guint i;
-	int uri_len = strlen(uri);
+	guint uri_len = strlen(uri);
 	for (i=0; i < GEANY(documents_array)->len; i++)
 	{
 		if (documents[i]->is_valid)
@@ -1197,7 +1200,7 @@ on_menu_show_bars(GtkMenuItem *menuitem, gpointer *user_data)
 }
 
 static GtkWidget*
-create_popup_menu(gchar *name, gchar *uri)
+create_popup_menu(const gchar *name, const gchar *uri)
 {
 	GtkWidget *item, *menu = gtk_menu_new();
 
@@ -1215,16 +1218,16 @@ create_popup_menu(gchar *name, gchar *uri)
 
 	item = ui_image_menu_item_new(GTK_STOCK_OPEN, _("Open externally"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-	g_signal_connect(item, "activate", G_CALLBACK(on_menu_open_externally), uri);
+	g_signal_connect(item, "activate", G_CALLBACK(on_menu_open_externally), (gpointer)uri);
 	gtk_widget_set_sensitive(item, is_exists);
 
 	item = ui_image_menu_item_new("utilities-terminal", _("Open Terminal"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-	g_signal_connect(item, "activate", G_CALLBACK(on_menu_open_terminal), uri);
+	g_signal_connect(item, "activate", G_CALLBACK(on_menu_open_terminal), (gpointer)uri);
 
 	item = ui_image_menu_item_new(GTK_STOCK_GOTO_TOP, _("Set as root"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-	g_signal_connect(item, "activate", G_CALLBACK(on_menu_set_as_root), uri);
+	g_signal_connect(item, "activate", G_CALLBACK(on_menu_set_as_root), (gpointer)uri);
 	gtk_widget_set_sensitive(item, is_dir);
 
 	item = ui_image_menu_item_new(GTK_STOCK_REFRESH, _("Refresh"));
@@ -1233,7 +1236,7 @@ create_popup_menu(gchar *name, gchar *uri)
 
 	item = ui_image_menu_item_new(GTK_STOCK_FIND, _("Find in Files"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-	g_signal_connect(item, "activate", G_CALLBACK(on_menu_find_in_files), uri);
+	g_signal_connect(item, "activate", G_CALLBACK(on_menu_find_in_files), (gpointer)uri);
 	gtk_widget_set_sensitive(item, is_dir);
 
 	item = gtk_separator_menu_item_new();
@@ -1241,11 +1244,11 @@ create_popup_menu(gchar *name, gchar *uri)
 
 	item = ui_image_menu_item_new(GTK_STOCK_ADD, _("Create new directory"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-	g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), "directory");
+	g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), (gpointer)"directory");
 
 	item = ui_image_menu_item_new(GTK_STOCK_NEW, _("Create new file"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-	g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), "file");
+	g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), (gpointer)"file");
 
 	item = ui_image_menu_item_new(GTK_STOCK_SAVE_AS, _("Rename"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
@@ -1262,17 +1265,17 @@ create_popup_menu(gchar *name, gchar *uri)
 
 	item = ui_image_menu_item_new(GTK_STOCK_CLOSE, g_strdup_printf(_("Close: %s"), name));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-	g_signal_connect(item, "activate", G_CALLBACK(on_menu_close), uri);
+	g_signal_connect(item, "activate", G_CALLBACK(on_menu_close), (gpointer)uri);
 	gtk_widget_set_sensitive(item, is_document);
 
 	item = ui_image_menu_item_new(GTK_STOCK_CLOSE, g_strdup_printf(_("Close Child Documents ")));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-	g_signal_connect(item, "activate", G_CALLBACK(on_menu_close_children), uri);
+	g_signal_connect(item, "activate", G_CALLBACK(on_menu_close_children), (gpointer)uri);
 	gtk_widget_set_sensitive(item, is_dir);
 
 	item = ui_image_menu_item_new(GTK_STOCK_COPY, _("Copy full path to clipboard"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-	g_signal_connect(item, "activate", G_CALLBACK(on_menu_copy_uri), uri);
+	g_signal_connect(item, "activate", G_CALLBACK(on_menu_copy_uri), (gpointer)uri);
 	gtk_widget_set_sensitive(item, is_exists);
 
 	item = gtk_separator_menu_item_new();
@@ -1388,7 +1391,7 @@ on_treeview_mouseclick(GtkWidget *widget, GdkEventButton *event, GtkTreeSelectio
 	GtkTreeIter 	iter;
 	GtkTreeModel 	*model;
 	GtkTreePath *path;
-	gchar 			*name = "", *uri = "";
+	const gchar 			*name = "", *uri = "";
 
 	if (gtk_tree_selection_get_selected(selection, &model, &iter))
 		/* FIXME: name and uri should be freed, but they are passed to create_popup_menu()
@@ -2068,6 +2071,6 @@ plugin_cleanup(void)
 {
 	g_free(addressbar_last_address);
 	g_free(CONFIG_FILE);
-	g_free(CONFIG_OPEN_EXTERNAL_CMD);
+	/* g_free(CONFIG_OPEN_EXTERNAL_CMD); */
 	gtk_widget_destroy(sidebar_vbox);
 }
