Index: theme/theme.inc
===================================================================
--- theme/theme.inc	(revision 3250)
+++ theme/theme.inc	(revision 3251)
@@ -604,7 +604,7 @@
     // set up defaults so that there's always something there.
     $widget->label = $widget->operator = $widget->widget = NULL;
 
-    $widget->id = $form[$info['value']]['#id'];
+    $widget->id = isset($form[$info['value']]['#id']) ? $form[$info['value']]['#id'] : '';
     if (!empty($info['label'])) {
       $widget->label = $info['label'];
     }
Index: includes/query.inc
===================================================================
--- includes/query.inc	(revision 3250)
+++ includes/query.inc	(revision 3251)
@@ -253,7 +253,7 @@
       return FALSE;
     }
 
-    if (!$join) {
+    if (!$join && isset($this->relationships[$relationship]['base'])) {
       $join = $this->get_join_data($table, $this->relationships[$relationship]['base']);
     }
 
