diff --git domain_solr.module domain_solr.module
index 0c25ebb..4dfefbf 100644
--- domain_solr.module
+++ domain_solr.module
@@ -11,7 +11,7 @@
  */
 function domain_solr_apachesolr_update_index(&$document, $node) {
   // Index group posts
-  
+
   foreach($node->domains as $domain) {
 
     $document->setMultiValue(_domain_solr_index_key(), $domain);
@@ -108,7 +108,7 @@ function domain_solr_block($op = 'list', $delta = 0, $edit = array()) {
           return;
         }
         $query = apachesolr_current_query();
-		
+
         return apachesolr_facet_block($response, $query, 'domain_solr', $delta, $delta, t('Filter by Site'), 'domain_solr_domain_name');
       }
       break;
@@ -129,6 +129,12 @@ function domain_solr_domain_name($facet, &$options) {
     return theme('placeholder', t('No domain'));
   }
 
+  // The gid in the {domain} table is unsigned, but the domain module
+  // makes it -1 for the deault domain.
+  if ($facet == -1) {
+    $facet = 0;
+  }
+
   return db_result(db_query("SELECT sitename FROM {domain} WHERE domain_id = %d", $facet));
 }
 
@@ -145,10 +151,16 @@ function domain_solr_theme() {
  * Theme the breadcrumb.
  */
 function theme_domain_solr_breadcrumb_im($domain_id) {
-  if (!is_numeric($group_id)) {
+  if (!is_numeric($domain_id)) {
     return t('No site');
   }
 
+  // The gid in the {domain} table is unsigned, but the domain module
+  // makes it -1 for the deault domain.
+  if ($domain_id == -1) {
+    $domain_id = 0;
+  }
+
   return db_result(db_query("SELECT sitename FROM {domain} WHERE domain_id = %d", $domain_id));
 }
 
