Index: capplets/common/gnome-theme-info.c
===================================================================
--- capplets/common/gnome-theme-info.c	(revision 7042)
+++ capplets/common/gnome-theme-info.c	(working copy)
@@ -1143,18 +1143,18 @@
   gboolean real_monitor_not_added = FALSE;
   GnomeVFSURI *index_uri;
 
-  /* Add the handle for this directory */
+  /* Add monitor for theme files */
   index_uri = gnome_vfs_uri_append_file_name (theme_dir_uri, "index.theme");
   update_icon_theme_index (index_uri, monitor_data->priority);
-  gnome_vfs_uri_unref (index_uri);
 
-  uri_string = gnome_vfs_uri_to_string (theme_dir_uri, GNOME_VFS_URI_HIDE_NONE);
+  uri_string = gnome_vfs_uri_to_string (index_uri, GNOME_VFS_URI_HIDE_NONE);
   result = gnome_vfs_monitor_add (& (monitor_data->common_icon_theme_dir_handle),
 				  uri_string,
-				  GNOME_VFS_MONITOR_DIRECTORY,
+				  GNOME_VFS_MONITOR_FILE,
 				  common_icon_theme_dir_changed,
 				  monitor_data);
   g_free (uri_string);
+  gnome_vfs_uri_unref (index_uri);
 
   if (result == GNOME_VFS_ERROR_NOT_SUPPORTED)
     real_monitor_not_added = TRUE;
@@ -1420,18 +1420,26 @@
 				       gpointer value,
 				       gpointer user_data)
 {
-  GList *list = value;
   struct GnomeThemeInfoHashData *hash_data;
+  const GList *list;
+  const GnomeThemeIconInfo *info;
 
   list = value;
   hash_data = user_data;
+  info = list->data;
 
-  hash_data->list = g_list_prepend (hash_data->list, list->data);
+  // Check if entry is valid, otherwize just remove it from hash table
+  if (gnome_vfs_get_local_path_from_uri(info->path))
+    hash_data->list = g_list_prepend (hash_data->list, list->data);
+  else {
+	g_hash_table_remove(icon_theme_hash_by_name, key);
+  }
 }
 
 GList *
 gnome_theme_icon_info_find_all (void)
 {
+  gint size_name, size_uri;
   
   struct GnomeThemeInfoHashData data;
   data.list = NULL;
@@ -1440,6 +1448,13 @@
 			gnome_theme_icon_info_find_all_helper,
 			&data);
 
+  size_name = g_hash_table_size(icon_theme_hash_by_name);
+  size_uri = g_hash_table_size(icon_theme_hash_by_uri);
+  if (size_uri != size_name) {
+	printf("DEBUG: Hash tables out of sync...\n");
+	printf("XX: uri: %d - name: %d\n", size_uri, size_name);
+  }
+
   return data.list;
 }
 
