--- nodewords.module	2009-12-30 20:22:06.000000000 -0500
+++ nodewords-patched.module	2010-04-14 22:19:39.000000000 -0400
@@ -540,7 +540,7 @@ function nodewords_preprocess_page(&$var
   drupal_alter('nodewords_tags_output', $output, $parameters);
 
   $variables['head'] = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" .
-    $output . "\n" . 
+    $output . "\n" .
     drupal_set_html_head();
 }
 
@@ -548,27 +548,34 @@ function nodewords_preprocess_page(&$var
  * Implements hook_taxonomy().
  */
 function nodewords_taxonomy($op, $type, $object = NULL) {
-  if ($type == NODEWORDS_TYPE_TERM) {
-    $id = $object['tid'];
-  }
-  elseif ($type == NODEWORDS_TYPE_VOCABULARY) {
-    $id = $object['vid'];
-  }
-  else {
-    return;
-  }
-
-  switch ($op) {
-    case 'delete':
-      nodewords_delete_tags($type, $id);
-      break;
-
-    case 'insert':
-    case 'update':
-      if (isset($object['nodewords'])) {
-        nodewords_save_tags($type, $id, $object['nodewords'], TRUE);
-      }
-      break;
+  if (isset($object)) {
+    switch ($type) {
+      case 'term':
+        $type = NODEWORDS_TYPE_TERM;
+        $id = $object['tid'];
+        break;
+
+      case 'vocabulary':
+        $type = NODEWORDS_TYPE_VOCABULARY;
+        $id = $object['vid'];
+        break;
+
+      default:
+        return;
+    }
+
+    switch ($op) {
+      case 'delete':
+        nodewords_delete_tags($type, $id);
+        break;
+
+      case 'insert':
+      case 'update':
+        if (isset($object['nodewords'])) {
+          nodewords_save_tags($type, $id, $object['nodewords'], TRUE);
+        }
+        break;
+    }
   }
 }
 
@@ -1300,7 +1307,7 @@ function _nodewords_detect_type_and_ids(
     $path = $page->path;
 
     if (drupal_match_path($_GET['q'], $path)) {
-      return array(NODEWORDS_TYPE_PAGE, $path);
+      return array(NODEWORDS_TYPE_PAGE, $page->pid);
     }
 
     $bool = (
@@ -1345,7 +1352,7 @@ function _nodewords_get_pages_data($id =
     $result = db_query("SELECT * FROM {nodewords_custom} ORDER BY weight ASC");
 
     while ($page = db_fetch_object($result)) {
-      $page->tags = nodewords_load_tags(NODEWORDS_TYPE_PAGE, $page->path);
+      $page->tags = nodewords_load_tags(NODEWORDS_TYPE_PAGE, $page->pid);
 
       $pages[$page->pid] = $page;
     }
