diff --git og_mailinglist.install og_mailinglist.install
index 583feb6..e9fca3b 100644
--- og_mailinglist.install
+++ og_mailinglist.install
@@ -17,6 +17,10 @@ function og_mailinglist_install() {
   else {
     drupal_set_message(st('The installation of the OG Mailinglist tables failed.'), 'error');
   }
+  
+  //set OGM's module_weight to be AFTER pathauto so our email footers always use the correct path
+  $weight = db_result(db_query("SELECT weight FROM {system} WHERE type = 'module' AND name = 'pathauto'"));
+  db_query("UPDATE {system} SET weight = %d WHERE type = 'module' AND name = 'og_mailinglist'", $weight + 1);
 }
 
 /**
@@ -312,7 +316,7 @@ function og_mailinglist_update_6004() {
 
 function add_groups_to_og_mailinglist() {
   if (!module_exists('purl') && !module_exists('spaces_og')) {
-    $results = db_query("SELECT nid, title FROM node WHERE type = 'group'");
+    $results = db_query("SELECT nid, title FROM {node} WHERE type = 'group'");
    
     $groups = array();
    
