diff --git a/includes/theme.inc b/includes/theme.inc
index edbd8d58cab95645e48c9695aa61866cfb95fb2f..6c83bf086eaadeeb0d3c2d02150d2e785f35b619 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -99,7 +99,7 @@ function list_themes($refresh = FALSE) {
 
   if (!$list) {
     $list = array();
-    $result = db_query("SELECT * FROM {system} WHERE type = 'theme' ORDER BY name");
+    $result = db_query("SELECT * FROM {system} WHERE type = 'theme' AND status = 1");
     while ($theme = db_fetch_object($result)) {
       if (file_exists($theme->filename)) {
         $list[$theme->name] = $theme;
diff --git a/modules/system.module b/modules/system.module
index 164732c47d0e98f2741259943cc807877d6af39e..5b9864f9bd502ffb5a54b7f13a051b7b8d9a70ad 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -126,14 +126,8 @@ function system_test() {
  */
 function system_user($type, $edit, &$user, $category = NULL) {
   if ($type == 'form' && $category == 'account') {
-    $allthemes = list_themes();
-
-    // list only active themes
-    foreach ($allthemes as $key => $theme) {
-      if ($theme->status) {
-        $themes[$key] = $theme;
-      }
-    }
+    $themes = list_themes();
+    ksort($themes);
 
     if (count($themes) > 1) {
       $rows = array();
@@ -145,8 +139,7 @@ function system_user($type, $edit, &$user, $category = NULL) {
         $row[] = file_exists($screenshot) ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $value->name)), '', array('class' => 'screenshot'), false) : t('no screenshot');
 
         // Information field.
-        $field = '<strong>'. $value->name .'</strong>';
-        $row[] = $field;
+        $row[] = '<strong>'. $value->name .'</strong>';
 
         // Reset to follow site default theme if user selects the site default
         if ($key == variable_get('theme_default', 'bluemarine')) {
@@ -485,7 +478,7 @@ function system_theme_listing() {
     // enabled, default, and operations columns
     $row[] = array('data' => form_checkbox('', 'status]['. $info->name, 1, $info->status), 'align' => 'center');
     $row[] = array('data' => form_radio('', 'theme_default', $info->name, (variable_get('theme_default', 'bluemarine') == $info->name) ? 1 : 0), 'align' => 'center');
-    if (function_exists($info->prefix . '_settings') || function_exists($info->prefix . '_features')) {
+    if ($info->status && (function_exists($info->prefix . '_settings') || function_exists($info->prefix . '_features'))) {
       $row[] = array('data' => l(t('configure'), 'admin/themes/settings/' . $info->name), 'align' => 'center');
     }
     else {
diff --git a/modules/system/system.module b/modules/system/system.module
index 164732c47d0e98f2741259943cc807877d6af39e..5b9864f9bd502ffb5a54b7f13a051b7b8d9a70ad 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -126,14 +126,8 @@ function system_test() {
  */
 function system_user($type, $edit, &$user, $category = NULL) {
   if ($type == 'form' && $category == 'account') {
-    $allthemes = list_themes();
-
-    // list only active themes
-    foreach ($allthemes as $key => $theme) {
-      if ($theme->status) {
-        $themes[$key] = $theme;
-      }
-    }
+    $themes = list_themes();
+    ksort($themes);
 
     if (count($themes) > 1) {
       $rows = array();
@@ -145,8 +139,7 @@ function system_user($type, $edit, &$user, $category = NULL) {
         $row[] = file_exists($screenshot) ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $value->name)), '', array('class' => 'screenshot'), false) : t('no screenshot');
 
         // Information field.
-        $field = '<strong>'. $value->name .'</strong>';
-        $row[] = $field;
+        $row[] = '<strong>'. $value->name .'</strong>';
 
         // Reset to follow site default theme if user selects the site default
         if ($key == variable_get('theme_default', 'bluemarine')) {
@@ -485,7 +478,7 @@ function system_theme_listing() {
     // enabled, default, and operations columns
     $row[] = array('data' => form_checkbox('', 'status]['. $info->name, 1, $info->status), 'align' => 'center');
     $row[] = array('data' => form_radio('', 'theme_default', $info->name, (variable_get('theme_default', 'bluemarine') == $info->name) ? 1 : 0), 'align' => 'center');
-    if (function_exists($info->prefix . '_settings') || function_exists($info->prefix . '_features')) {
+    if ($info->status && (function_exists($info->prefix . '_settings') || function_exists($info->prefix . '_features'))) {
       $row[] = array('data' => l(t('configure'), 'admin/themes/settings/' . $info->name), 'align' => 'center');
     }
     else {