diff --git a/domain_theme/domain_theme.admin.inc b/domain_theme/domain_theme.admin.inc
index 9af47e3..b7013e8 100644
--- domain_theme/domain_theme.admin.inc
+++ domain_theme/domain_theme.admin.inc
@@ -260,11 +260,11 @@ function theme_domain_theme_reset($domain) {
  * @param $domain
  *  The $domain object created by domain_lookup().
  */
-function domain_theme_settings($theme, $domain) {
+function domain_theme_settings($in_theme, $domain) {
   // Load the system form file.
   include_once(drupal_get_path('module', 'system') .'/system.admin.inc');
-  $theme = db_fetch_array(db_query("SELECT theme, settings FROM {domain_theme} WHERE domain_id = %d AND theme = '%s'", $domain['domain_id'], $theme));
+  $theme = db_fetch_array(db_query("SELECT theme, settings FROM {domain_theme} WHERE domain_id = %d AND theme = '%s'", $domain['domain_id'], $in_theme));
   drupal_set_message(t('You are viewing the %theme settings for %domain.', array('%theme' => $theme['theme'], '%domain' => $domain['sitename'])));
   // Write uploads to the proper directory?
   if ($domain['domain_id'] > 0) {
@@ -278,7 +278,7 @@ function domain_theme_settings($theme, $domain) {
     return drupal_get_form('system_theme_settings', $theme['theme']);
   }
   else {
-    return drupal_get_form('system_theme_settings');
+    return drupal_get_form('system_theme_settings', $in_theme);
   }
 }
 
