--- wordpress-orig.php	2009-11-12 11:28:36.000000000 -0800
+++ wordpress.php	2009-12-07 14:13:42.000000000 -0800
@@ -290,14 +290,17 @@
 	function process_categories() {
 		global $wpdb;
 
-		$cat_names = (array) get_terms('category', 'fields=names');
+		if ( !is_array( $this->categories ) )
+			return;
 
 		while ( $c = array_shift($this->categories) ) {
 			$cat_name = trim($this->get_tag( $c, 'wp:cat_name' ));
 
 			// If the category exists we leave it alone
-			if ( in_array($cat_name, $cat_names) )
+			$cat_id = (int) category_exists( $cat_name );
+			if ( 0 < $cat_id ) {
 				continue;
+			}
 
 			$category_nicename	= $this->get_tag( $c, 'wp:category_nicename' );
 			$category_description = $this->get_tag( $c, 'wp:category_description' );
@@ -320,14 +323,16 @@
 	function process_tags() {
 		global $wpdb;
 
-		$tag_names = (array) get_terms('post_tag', 'fields=names');
+		if ( !is_array( $this->tags ) )
+			return;
 
 		while ( $c = array_shift($this->tags) ) {
 			$tag_name = trim($this->get_tag( $c, 'wp:tag_name' ));
 
-			// If the category exists we leave it alone
-			if ( in_array($tag_name, $tag_names) )
+			// If the tag exists we leave it alone
+			if ( is_term( $tag_name, 'post_tag' ) ) {
 				continue;
+			}
 
 			$slug = $this->get_tag( $c, 'wp:tag_slug' );
 			$description = $this->get_tag( $c, 'wp:tag_description' );
