diff --git a/domain_theme/domain_theme.admin.inc b/domain_theme/domain_theme.admin.inc
index d67316b..d62d4f7 100644
--- a/domain_theme/domain_theme.admin.inc
+++ b/domain_theme/domain_theme.admin.inc
@@ -331,6 +331,15 @@ function domain_theme_settings_submit($form, &$form_state) {
       ->execute();
     drupal_set_message(t('%theme has been set as the default theme for %domain', array('%theme' => $theme, '%domain' => $domain['sitename'])));
   }
+  // Keep the default domain in sync.
+  if ($domain_id == domain_default_id()) {
+    variable_set('theme_default', $theme);
+    variable_set('theme_' . $theme . '_settings', $values);
+    db_update('domain_theme')
+      ->condition('domain_id', $domain_id)
+      ->fields(array('settings' => ''))
+      ->execute();
+  }
   // Clear the cache.
   cache_clear_all();
   // Finish processing the form.
diff --git a/domain_theme/domain_theme.module b/domain_theme/domain_theme.module
index ad6c5d9..2ce0860 100644
--- a/domain_theme/domain_theme.module
+++ b/domain_theme/domain_theme.module
@@ -179,31 +179,30 @@ function domain_theme_domain_form(&$form) {
  */
 function domain_theme_batch_submit($values) {
   foreach ($values['domain_batch'] as $key => $value) {
-    if ((int) $key != domain_default_id()) {
-      // Clear out the old theme.
+    // Clear out the old theme.
+    db_update('domain_theme')
+      ->fields(array('status' => 0))
+      ->condition('domain_id', $key)
+      ->execute();
+    $data = db_query("SELECT theme FROM {domain_theme} WHERE theme = :theme AND domain_id = :domain_id",
+      array(':theme' => $value, ':domain_id' => $key))->fetchField();
+    if (!empty($data) && $data == $value) {
       db_update('domain_theme')
-        ->fields(array('status' => 0))
+        ->fields(array('status' => 1))
         ->condition('domain_id', $key)
+        ->condition('theme', $value)
         ->execute();
-      $data = db_query("SELECT theme FROM {domain_theme} WHERE theme = :theme AND domain_id = :domain_id",
-        array(':theme' => $value, ':domain_id' => $key))->fetchField();
-      if (!empty($data) && $data == $value) {
-        db_update('domain_theme')
-          ->fields(array('status' => 1))
-          ->condition('domain_id', $key)
-          ->condition('theme', $value)
-          ->execute();
-      }
-      else {
-        db_insert('domain_theme')
-          ->fields(array(
-            'domain_id' => $key,
-            'theme' => $value,
-            'status' => 1,
-        ))->execute();
-      }
     }
     else {
+      db_insert('domain_theme')
+        ->fields(array(
+          'domain_id' => $key,
+          'theme' => $value,
+          'status' => 1,
+      ))->execute();
+    }
+    // Set the default for the primary domain.
+    if ((int) $key == domain_default_id()) {
       variable_set('theme_default', $value);
     }
   }
