Index: includes/theme.inc
=========================
--- includes/theme.inc	Fri Sep 24 23:20:08 2010
+++ includes/theme.inc	Sun Sep 26 12:21:40 2010
@@ -1404,9 +1404,9 @@
   global $language_url;
   $output = '';
 
-  if (count($links) > 0) {
-    $output = '';
+  $num_links = count($links);
 
+  if ($num_links > 0) {
     // Treat the heading first if it is present to prepend it to the
     // list of links.
     if (!empty($heading)) {
@@ -1428,7 +1428,6 @@
 
     $output .= '<ul' . drupal_attributes($attributes) . '>';
 
-    $num_links = count($links);
     $i = 1;
 
     foreach ($links as $key => $link) {
