Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 18098)
+++ wp-includes/taxonomy.php	(working copy)
@@ -1893,6 +1893,8 @@
 	} else if ( 'tt_ids' == $fields ) {
 		$terms = $wpdb->get_col("SELECT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($object_ids) AND tt.taxonomy IN ($taxonomies) $orderby $order");
 	}
+	if ( 'ids' == $fields || 'tt_ids' == $fields )
+		$terms = array_map( create_function( '$value', 'return (int) $value;' ), $terms );
 
 	if ( ! $terms )
 		$terms = array();
