Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.722
diff -u -r1.722 system.module
--- modules/system/system.module	5 Jul 2009 18:00:10 -0000	1.722
+++ modules/system/system.module	13 Jul 2009 10:30:11 -0000
@@ -1571,7 +1571,7 @@
  * @return
  *    a form array
  */
-function system_theme_select_form($description = '', $default_value = '', $weight = 0) {
+function system_theme_select_form($description = '', $default_value = 0, $weight = 0) {
   if (user_access('select different theme')) {
     $enabled = array();
     $themes = list_themes();
@@ -1595,7 +1595,7 @@
 
       foreach ($enabled as $info) {
         // For the default theme, revert to an empty string so the user's theme updates when the site theme is changed.
-        $info->key = $info->name == variable_get('theme_default', 'garland') ? '' : $info->name;
+        $info->key = $info->name == variable_get('theme_default', 'garland') ? 0 : $info->name;
 
         $screenshot = NULL;
         $theme_key = $info->name;
@@ -1614,7 +1614,7 @@
         $options[$info->key] = '';
       }
 
-      $form['themes']['theme'] = array('#type' => 'radios', '#options' => $options, '#default_value' => $default_value ? $default_value : '');
+      $form['themes']['theme'] = array('#type' => 'radios', '#options' => $options, '#default_value' => $default_value);
       $form['#weight'] = $weight;
       return $form;
     }
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.497
diff -u -r1.497 theme.inc
--- includes/theme.inc	2 Jul 2009 04:27:22 -0000	1.497
+++ includes/theme.inc	13 Jul 2009 10:30:10 -0000
@@ -53,7 +53,7 @@
 
   // Only select the user selected theme if it is available in the
   // list of enabled themes.
-  $theme = !empty($user->theme) && !empty($themes[$user->theme]->status) ? $user->theme : variable_get('theme_default', 'garland');
+  $theme = !empty($user->theme) && ($user->theme != 0) && !empty($themes[$user->theme]->status) ? $user->theme : variable_get('theme_default', 'garland');
 
   // Allow modules to override the present theme... only select custom theme
   // if it is available in the list of installed themes.
