diff --git a/view_alias.module b/view_alias.module
index 695cca9626b4ba57a77e8a72575104e5d312245a..ff07e56a45068afaf5bce973ea160f730d48d613 100644
--- a/view_alias.module
+++ b/view_alias.module
@@ -8,7 +8,7 @@
  */
 
 /**
- * Implementation of hook_pathauto()
+ * Implementation of hook_pathauto().
  */
 function view_alias_pathauto($op) {
   switch ($op) {
@@ -17,17 +17,14 @@ function view_alias_pathauto($op) {
       $settings['module'] = 'view_alias';
       $settings['token_type'] = 'view_alias';
       $settings['groupheader'] = t('View Alias settings');
-      $settings['patterndescr'] = t('Default View Alias pattern
-        (applies to all views with a term argument and page display)');
-      $settings['patterndefault'] = '';
+      $settings['patterndescr'] = t('Default View Alias pattern (applies to all views with a term argument and page display)');
+      $settings['patterndefault'] = t('');
       $settings['bulkname'] = t('Bulk generate aliases for views with term arguments that are not aliased');
-      $settings['bulkdescr'] = t('Generate aliases for all existing views with term arguments
-        which do not already have aliases.');
+      $settings['bulkdescr'] = t('Generate aliases for all existing views with term arguments which do not already have aliases.');
       
       // left out patterns since we dont use them.
-      $settings['placeholders'] = array( t('[cat-raw]'), t('The View argument taxonomy name'));
-
-      $settings['patternitems'] = array();
+      $settings['placeholders'] = array();
+      
       return (object) $settings;
 
     default:
@@ -42,11 +39,13 @@ function view_alias_pathauto($op) {
  */
 function view_alias_pathauto_bulkupdate() {
   $aliasable = _get_aliasable_displays();
-  
+  $terms = array();
   foreach ($aliasable as $alias) {
     if (variable_get("pathauto_view_alias_{$alias->path}", FALSE)) {
-      $terms = _gather_terms_for_alias($alias->varg);
-
+      $varg = explode(',', $alias->varg);
+      foreach($varg as $vocab) {
+        $terms = array_merge($terms, taxonomy_get_tree($vocab));
+      }
       foreach ($terms as $term) {
         view_alias_create_alias($term, $alias, 'bulkupdate');
       }
@@ -54,19 +53,6 @@ function view_alias_pathauto_bulkupdate() {
   }
 }
 
-function _gather_terms_for_alias($validator_vocab_ids) {
-  $vocabs = explode(",", $validator_vocab_ids);
-
-  $terms_to_alias = array();
-
-  foreach($vocabs as $vocab) {
-    $terms = taxonomy_get_tree($vocab);
-    $terms_to_alias = array_merge($terms_to_alias, $terms);
-  }
-
-  return $terms_to_alias;
-}
-
 /**
  *
  * Implementation of hook_path_alais_types from pathauto
@@ -76,10 +62,9 @@ function _gather_terms_for_alias($validator_vocab_ids) {
 function view_alias_path_alias_types() {
   $aliasable = _get_aliasable_displays();
   foreach($aliasable as $alias) {
-    $objects[$alias->path] = t('View page displays having a path of %path', array('%path' => $alias->path));
+    $objects["$alias->path/%"] = t("View page displays having a path of '$alias->path'");
   }
-
-  return $objects;
+  return $objects;  
 }
 
 /**
@@ -91,7 +76,7 @@ function view_alias_path_alias_types() {
  */
 function view_alias_form_alter(&$form, $form_state, $form_id) {
   if($form_id == 'pathauto_admin_settings') {
-
+    
     unset($form['view_alias']['pathauto_view_alias_pattern']);
     unset($form['view_alias']['token_help']);
     $form['view_alias']['views_to_alias'] = array(
@@ -106,14 +91,7 @@ function view_alias_form_alter(&$form, $form_state, $form_id) {
       $voc = taxonomy_vocabulary_load($alias->varg);
       $form['view_alias']['views_to_alias']["pathauto_view_alias_{$alias->path}"] = array(
         '#type' => 'checkbox',
-        '#title' => t('View %view, display %display, on path %path, with %vocab arguments.',
-          array(
-            '%view'     => $alias->view_name,
-            '%display'  => $alias->display_name,
-            '%path'     => $alias->path,
-            '%vocab'    => $voc->name
-          )
-        ),
+        '#title' => t("View $alias->view_name, display $alias->display_name, on path $alias->path, with $voc->name arguments."),
         '#weight' => -1,
         '#default_value' => variable_get("pathauto_view_alias_{$alias->path}", 0),
       );
@@ -129,7 +107,8 @@ function view_alias_taxonomy($op, $type, $array = NULL) {
     $term = (object) $array;
     $aliasable = _get_aliasable_displays();
     foreach ($aliasable as $alias) {
-      if ($alias->varg == $term->vid) {
+      $varg = explode(',', $alias->varg);
+      if (in_array($term->vid, $varg)) {
         if ($op == 'delete') {
           view_alias_delete_alias($term, $alias);
         }
@@ -146,23 +125,22 @@ function view_alias_taxonomy($op, $type, $array = NULL) {
  */
 function view_alias_create_alias($term, $alias, $op) {
   module_load_include('inc', 'pathauto');
-  
-  // switch around the pattern based on if the term id is contained within the new alias
   if (strpos($alias->path, '%') === FALSE) {
     $source = "$alias->path/$term->tid";
-    $GLOBALS['conf']['pathauto_view_alias_pattern'] = $alias->path."/[cat-raw]";
   }
   else {
     $source = str_replace('%', $term->tid, $alias->path);
-    $GLOBALS['conf']['pathauto_view_alias_pattern'] = str_replace('%', '[cat-raw]', $alias->path);
   }
 
-  $placeholders = array(
-    'tokens' => array(t('[cat-raw]')),
+  // Pathauto uses variable_get() to retrieve patterns. Since we need multiple
+  // patterns for every path, we temporarily override the variable
+  // "pathauto_view_alias_pattern" which Pathauto will check for this operation.
+  $GLOBALS['conf']['pathauto_view_alias_pattern'] = $alias->path;
+  $replacements = array(
+    'tokens' => array('%'),
     'values' => array(pathauto_cleanstring($term->name)),
   );
-
-  $alias_path = pathauto_create_alias('view_alias', $op, $placeholders, $source, $alias->path);
+  $alias_path = pathauto_create_alias('view_alias', $op, $replacements, $source, $term->tid);
   unset($GLOBALS['conf']['pathauto_view_alias_pattern']);
   return $alias_path;
 }
@@ -171,16 +149,20 @@ function view_alias_create_alias($term, $alias, $op) {
  * Delete an alias set by View Alias.
  */
 function view_alias_delete_alias($term, $alias) {
-  $alias_path = view_alias_create_alias($term, $alias, 'update');
-  path_set_alias(NULL, $alias_path);
+  if (strpos($alias->path, '%') === FALSE) {
+    $source = "$alias->path/$term->tid";
+  }
+  else {
+    $source = str_replace('%', $term->tid, $alias->path);
+  }
+  path_set_alias($source, NULL);
 }
 
 /**
  *
  * find the views that can be aliased.
  * that means have a path url and use a term id as an argument
- * build and array of objects, keyed with the view name,
- * having the view path, and the vocab id for the terms used
+ * build and array of objects, keyed with the view name, having the view path, and the vocab id for the terms used
  * array(
  *   0 => 
  *     object ( 
@@ -194,34 +176,34 @@ function view_alias_delete_alias($term, $alias) {
 function _get_aliasable_displays() {
   $aliasable_views = array();
 
-  $sql = "SELECT DISTINCT(vv.name) FROM {views_view} vv JOIN {views_display} vd ";
+  $sql = "SELECT DISTINCT(vv.name) FROM views_view vv JOIN views_display vd ";
   $sql .= "ON vv.vid = vd.vid where vd.display_plugin = 'page'";
-
+  
   $result = db_query($sql);
   while($row = db_fetch_object($result)) {
     $aview = views_get_view($row->name);
     $alias = NULL;
     $alias->view_name = $row->name;
     $default_vocab_arg;
-
     foreach($aview->display as $key => $display) {
       // check default for args and save for later
       $alias->display_name = $key;
-
+      
       if($key == 'default') {
         $alias->varg = _find_view_arguments($display);
         continue;
       }
       // its some sort of page cause the query says so.
       else {
+        //dpr($display);
         // add the page and replace overridden args.
-        $alias->path = $display->display_options['path'];
+        $alias->path = $display->display_options['path'];       
         $overridden = _find_view_arguments($display);
-        if($overridden) {
+        if($overridden) { 
           $alias->varg = $overridden;
         }
       }
-      if(!empty($alias->path) && !empty($alias->varg))
+      if(!empty($alias->path) && !empty($alias->varg))   
         $aliasable_views[] = drupal_clone($alias);
     }
 
@@ -236,14 +218,12 @@ function _get_aliasable_displays() {
 function _find_view_arguments($display) {
   $dis_args = $display->display_options['arguments']['tid'];
   // array_sum is used since if no vocabularies are selected, the sum of the argumets will be 0
-  // and we need to make sure there is a vocabular set
-  if($dis_args['validate_argument_type'] == 'tid' &&
-    array_sum($dis_args['validate_argument_vocabulary']) > 0) {
+  // and we need to make sure there is a vocabular set.
+
+  if($dis_args['validate_argument_type'] == 'tid' && array_sum($dis_args['validate_argument_vocabulary']) > 0) {
     // remove zero entries
     $no_zeroes = array_diff($dis_args['validate_argument_vocabulary'], array(0));
-
-    $view_args = implode(",", $no_zeroes);
-    return $view_args;
+    return implode(",", $no_zeroes);
   }
   return FALSE; 
-}
\ No newline at end of file
+}
