Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 20980)
+++ wp-includes/taxonomy.php	(working copy)
@@ -2227,8 +2227,6 @@
  * If that still doesn't return an unique slug, then it try to append a number
  * until it finds a number that is truly unique.
  *
- * The only purpose for $term is for appending a parent, if one exists.
- *
  * @package WordPress
  * @subpackage Taxonomy
  * @since 2.3.0
@@ -2263,8 +2261,8 @@
 	}
 
 	// If we didn't get a unique slug, try appending a number to make it unique.
-	if ( !empty($args['term_id']) )
-		$query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $args['term_id'] );
+	if ( ! empty( $term->term_id ) )
+		$query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $term->term_id );
 	else
 		$query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug );
 
