Index: lib/rb-util.c
===================================================================
--- lib/rb-util.c	(revision 5889)
+++ lib/rb-util.c	(working copy)
@@ -329,13 +329,29 @@
 	GFile *file;
 	GFileInfo *info;
 	char *fstype = NULL;
+	GError *error = NULL;
 
 	file = g_file_new_for_uri (uri);
-	info = g_file_query_filesystem_info (file, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, NULL, NULL);
+	info = g_file_query_filesystem_info (file, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, NULL, &error);
 	if (info != NULL) {
 		fstype = g_file_info_get_attribute_as_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
 		g_object_unref (info);
 	}
+
+	if (error && error->code == G_IO_ERROR_NOT_FOUND) {
+		GFile *parent = g_file_get_parent(file);
+		gchar *parent_uri;
+		if (parent) {
+			parent_uri = g_file_get_uri(parent);
+			fstype = rb_uri_get_filesystem_type(parent_uri);
+			g_free(parent_uri);
+			g_object_unref(parent);
+		}
+	}
+	if (error) {
+		g_error_free(error);
+	}
+
 	g_object_unref (file);
 	return fstype;
 }
Index: lib/rb-file-helpers.c
===================================================================
--- lib/rb-file-helpers.c	(revision 5889)
+++ lib/rb-file-helpers.c	(working copy)
@@ -981,7 +981,7 @@
 		}
 
 		g_strdelimit (full_path, "\"", '\'');
-		g_strdelimit (full_path, ":|<>*?\\", '_');
+		g_strdelimit (full_path, ":|<>*?\\#", '_');
 
 		/* create a new uri from this */
 		sane_uri = g_filename_to_uri (full_path, hostname, &error);
