=== modified file 'uc_catalog/uc_catalog.install'
--- uc_catalog/uc_catalog.install	2010-03-15 13:29:09 +0000
+++ uc_catalog/uc_catalog.install	2010-03-15 20:08:01 +0000
@@ -28,21 +28,24 @@
     taxonomy_vocabulary_save($vocabulary);
     $vid = $vocabulary->vid;
 
-    $field = array(
-      'field_name' => 'taxonomy_catalog',
-      'type' => 'taxonomy_term_reference',
-      // Set cardinality to unlimited for tagging.
-      'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'settings' => array(
-        'allowed_values' => array(
-          array(
-            'vid' => $vocabulary->vid,
-            'parent' => 0,
+    $field = field_info_field('taxonomy_' . $vocabulary->machine_name);
+    if (empty($field)) {
+      $field = array(
+        'field_name' => 'taxonomy_' . $vocabulary->machine_name,
+        'type' => 'taxonomy_term_reference',
+        'cardinality' => FIELD_CARDINALITY_UNLIMITED,
+        'settings' => array(
+          'allowed_values' => array(
+            array(
+              'vid' => $vocabulary->vid,
+              'parent' => 0,
+            ),
           ),
         ),
-      ),
-    );
-    field_create_field($field);
+      );
+
+      field_create_field($field);
+    }
   }
 
   uc_catalog_add_image_field();
@@ -56,7 +59,9 @@
  */
 function uc_catalog_uninstall() {
   if ($vid = variable_get('uc_catalog_vid', 0)) {
+    $vocabulary = taxonomy_vocabulary_load($vid);
     taxonomy_vocabulary_delete($vid);
+    field_delete_field('taxonomy_' . $vocabulary->machine_name);
   }
 
   db_delete('variable')

=== modified file 'uc_catalog/uc_catalog.module'
--- uc_catalog/uc_catalog.module	2010-03-12 18:51:12 +0000
+++ uc_catalog/uc_catalog.module	2010-03-15 20:08:01 +0000
@@ -990,28 +990,27 @@
     );
 
     field_create_field($field);
-
-    // Initialize this because field_info_field() would have set it.
-    $field['bundles'] = array();
   }
 
-  $label = t('Image');
-  $instance = array(
-    'field_name' => 'uc_catalog_image',
-    'object_type' => 'taxonomy_term',
-    'bundle' => 'taxonomy_catalog',
-    'label' => $label,
-    'widget_type' => 'image_image',
-    'display' => array(
-      'full' => array(
-        'label' => 'hidden',
-        'type' => 'image_link_content__uc_category'
-      ),
-    ),
-  );
+  $instance = field_info_instance('taxonomy_term', 'uc_catalog_image', 'taxonomy_catalog');
 
   // Only add the instance if it doesn't exist. Don't overwrite any changes.
-  if (!in_array('taxonomy_catalog', $field['bundles'])) {
+  if (!$instance) {
+    $label = t('Image');
+    $instance = array(
+      'field_name' => 'uc_catalog_image',
+      'object_type' => 'taxonomy_term',
+      'bundle' => 'taxonomy_catalog',
+      'label' => $label,
+      'widget_type' => 'image_image',
+      'display' => array(
+        'full' => array(
+          'label' => 'hidden',
+          'type' => 'image_link_content__uc_category'
+        ),
+      ),
+    );
+
     field_create_instance($instance);
   }
 }

=== modified file 'uc_product/uc_product.install'
--- uc_product/uc_product.install	2010-03-15 13:29:09 +0000
+++ uc_product/uc_product.install	2010-03-15 20:08:01 +0000
@@ -217,7 +217,9 @@
  */
 function uc_product_uninstall() {
   db_delete('variable')
-    ->condition('name', 'uc_product_shippable_%', 'LIKE')
+    ->condition(db_or()
+      ->condition('name', 'uc_product_shippable_%', 'LIKE')
+      ->condition('name', 'uc_image_%', 'LIKE'))
     ->execute();
 
   variable_del('uc_product_nodes_per_page');

=== modified file 'uc_product/uc_product.module'
--- uc_product/uc_product.module	2010-03-12 15:24:39 +0000
+++ uc_product/uc_product.module	2010-03-15 20:31:07 +0000
@@ -2029,7 +2029,7 @@
   }
 
   $label = t('Image');
-  $instance = array(
+  $new_instance = array(
     'object_type' => 'node',
     'label' => $label,
     'weight' => -2,
@@ -2054,17 +2054,19 @@
     $types = uc_product_types();
   }
   foreach ($types as $type) {
-    $instance['bundle'] = $type;
+    $new_instance['bundle'] = $type;
 
     $field_name = variable_get('uc_image_'. $type, '');
     if (empty($field_name)) {
       $field_name = 'uc_product_image';
     }
-    $instance['field_name'] = $field_name;
+    $new_instance['field_name'] = $field_name;
+
+    $instance = field_info_instance('node', $field_name, $type);
 
     // Only add the instance if it doesn't exist. Don't overwrite any changes.
-    if (!in_array($type, $field['bundles'])) {
-      field_create_instance($instance);
+    if (!$instance) {
+      field_create_instance($new_instance);
       variable_set('uc_image_'. $type, $field_name);
     }
   }

