Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.376
diff -u -p -r1.376 theme.inc
--- includes/theme.inc	30 Aug 2007 19:54:21 -0000	1.376
+++ includes/theme.inc	30 Aug 2007 23:37:18 -0000
@@ -41,7 +41,7 @@ function init_theme() {
 
   // Only select the user selected theme if it is available in the
   // list of enabled themes.
-  $theme = !empty($user->theme) && $themes[$user->theme]->status ? $user->theme : variable_get('theme_default', 'garland');
+  $theme = !empty($user->theme) && !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.
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.525
diff -u -p -r1.525 system.module
--- modules/system/system.module	29 Aug 2007 14:57:49 -0000	1.525
+++ modules/system/system.module	30 Aug 2007 23:37:19 -0000
@@ -518,7 +518,7 @@ function system_admin_theme_submit($form
  * @return
  *    a form array
  */
-function system_theme_select_form(&$form_state, $description = '', $default_value = '', $weight = 0) {
+function system_theme_select_form($description = '', $default_value = '', $weight = 0) {
   if (user_access('select different theme')) {
     $enabled = array();
     $themes = list_themes();
