Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 21842)
+++ wp-includes/taxonomy.php	(working copy)
@@ -1342,7 +1342,7 @@
 		$where .= ' AND tt.count > 0';
 
 	// don't limit the query results when we have to descend the family tree
-	if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' === $parent ) {
+	if ( $number && ! $hierarchical && ! $child_of && '' === $parent ) {
 		if ( $offset )
 			$limits = 'LIMIT ' . $offset . ',' . $number;
 		else
@@ -1447,9 +1447,8 @@
 		$terms = $_terms;
 	}
 
-	if ( 0 < $number && intval(@count($terms)) > $number ) {
-		$terms = array_slice($terms, $offset, $number);
-	}
+	if ( $number && is_array( $terms ) && count( $terms ) > $number )
+		$terms = array_slice( $terms, $offset, $number );
 
 	wp_cache_add( $cache_key, $terms, 'terms', 86400 ); // one day
 
