diff -urN drupal-7.0-rc2/includes/common.inc www.patched/includes/common.inc
--- drupal-7.0-rc2/includes/common.inc	2010-12-11 03:22:37.000000000 +0100
+++ www.patched/includes/common.inc	2010-12-12 15:28:01.136666668 +0100
@@ -5887,27 +5887,6 @@
 }
 
 /**
- * Function used by uasort to sort structured arrays by weight.
- */
-function element_sort($a, $b) {
-  $a_weight = (is_array($a) && isset($a['#weight'])) ? $a['#weight'] : 0;
-  $b_weight = (is_array($b) && isset($b['#weight'])) ? $b['#weight'] : 0;
-  if ($a_weight == $b_weight) {
-    return 0;
-  }
-  return ($a_weight < $b_weight) ? -1 : 1;
-}
-
-/**
- * Array sorting callback; sorts elements by title.
- */
-function element_sort_by_title($a, $b) {
-  $a_title = (is_array($a) && isset($a['#title'])) ? $a['#title'] : '';
-  $b_title = (is_array($b) && isset($b['#title'])) ? $b['#title'] : '';
-  return strnatcasecmp($a_title, $b_title);
-}
-
-/**
  * Retrieve the default properties for the defined element type.
  *
  * @param $type
@@ -5952,12 +5931,9 @@
  * Function used by uasort to sort structured arrays by weight, without the property weight prefix.
  */
 function drupal_sort_weight($a, $b) {
-  $a_weight = (is_array($a) && isset($a['weight'])) ? $a['weight'] : 0;
-  $b_weight = (is_array($b) && isset($b['weight'])) ? $b['weight'] : 0;
-  if ($a_weight == $b_weight) {
-    return 0;
-  }
-  return ($a_weight < $b_weight) ? -1 : 1;
+  $a_weight = (is_array($a) && isset($a['#weight'])) ? (int) $a['#weight'] : 0;
+  $b_weight = (is_array($b) && isset($b['#weight'])) ? (int) $b['#weight'] : 0;
+  return $a_weight - $b_weight;
 }
 
 /**
@@ -6021,7 +5997,7 @@
   }
   // Sort the children if necessary.
   if ($sort && $sortable) {
-    uasort($children, 'element_sort');
+    uasort($children, 'drupal_sort_weight');
     // Put the sorted children back into $elements in the correct order, to
     // preserve sorting if the same element is passed through
     // element_children() twice.
diff -urN drupal-7.0-rc2/modules/system/system.admin.inc www.patched/modules/system/system.admin.inc
--- drupal-7.0-rc2/modules/system/system.admin.inc	2010-11-23 03:54:13.000000000 +0100
+++ www.patched/modules/system/system.admin.inc	2010-12-12 15:28:01.126666669 +0100
@@ -890,7 +890,7 @@
   }
 
   // Lastly, sort all fieldsets by title.
-  uasort($form['modules'], 'element_sort_by_title');
+  uasort($form['modules'], 'drupal_sort_title');
 
   $form['actions'] = array('#type' => 'actions');
   $form['actions']['submit'] = array(
