--- filebrowser.orig.module	2008-08-19 19:50:28.000000000 -0500
+++ filebrowser.module	2008-11-11 14:27:43.000000000 -0600
@@ -240,9 +240,11 @@ function filebrowser_view($node, $teaser
 
   // Grab various Drupal paths.
   $path_alias = drupal_get_path_alias('node/' . $node->nid);
-  // Handle both aliased and non-aliased cases.
-  $subdir = str_replace($path_alias, '', $_GET['q']);
-  $subdir = str_replace('node/' . $node->nid, '', $_GET['q']); 
+  $subdir  = '';
+  $partnum = 2;
+  while (null != ($part = arg($partnum++))) {
+    $subdir .= '/' . $part; 
+  }
   $curr_dir = $node->file_path . $subdir;
   
   // Keep track of the current location and update breadcrumbs to reflect that.
