diff -r -U 3 a/includes/common.inc b/includes/common.inc
--- a/includes/common.inc       2011-11-01 05:30:42.000000000 +0000
+++ b/includes/common.inc       2011-11-01 05:30:50.000000000 +0000
@@ -2308,6 +2308,9 @@
   global $language_url;
   static $use_theme = NULL;
 
+  // Check for invalid options, e.g. null
+  if (!is_array($options)) $options = array();
+
   // Merge in defaults.
   $options += array(
     'attributes' => array(),
diff -r -U 3 a/includes/entity.inc b/includes/entity.inc
--- a/includes/entity.inc       2011-11-01 05:34:29.000000000 +0000
+++ b/includes/entity.inc       2011-11-01 05:34:20.000000000 +0000
@@ -160,6 +160,16 @@
   public function load($ids = array(), $conditions = array()) {
     $entities = array();
 
+    // Clean the $ids array to remove non-integer values that can be passed
+    // in from various sources, including menu callbacks.
+    if (is_array($ids)) {
+      foreach ($ids as $key => $id) {
+        if (empty($id) || ((string) $id !== (string) (int) $id)) {
+          unset($ids[$key]);
+        }
+      }
+    }
+
     // Revisions are not statically cached, and require a different query to
     // other conditions, so separate the revision id into its own variable.
     if ($this->revisionKey && isset($conditions[$this->revisionKey])) {
diff -r -U 3 a/sites/all/modules/pathauto/pathauto.inc b/sites/all/modules/pathauto/pathauto.inc
--- a/sites/all/modules/pathauto/pathauto.inc   2011-11-01 05:31:56.000000000 +0000
+++ b/sites/all/modules/pathauto/pathauto.inc   2011-11-01 05:32:06.000000000 +0000
@@ -438,7 +438,15 @@
  *   TRUE if the path already exists.
  */
 function _pathauto_path_is_callback($path) {
-  $menu = menu_get_item($path);
+  // We need to use a try/catch here because of a core bug which will throw an
+  // exception if $path is something like 'node/foo/bar'.
+  // @todo Remove when http://drupal.org/node/1302158 is fixed in core.
+  try {
+    $menu = menu_get_item($path);
+  }
+  catch (Exception $e) {
+    return FALSE;
+  }
   if (isset($menu['path']) && $menu['path'] == $path) {
     return TRUE;
   }
@@ -575,7 +583,6 @@
     if (!preg_match('/(path|alias|url|url-brief)\]$/', $token)) {
       $replacements[$token] = pathauto_cleanstring($value);
     }
-    // @todo Clean up 'tree-style' tokens that are not actually URLs.
   }
 }
 

