Index: modules/node/content_types.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v
retrieving revision 1.42
diff -u -F^f -r1.42 content_types.inc
--- modules/node/content_types.inc	5 Oct 2007 13:17:09 -0000	1.42
+++ modules/node/content_types.inc	5 Oct 2007 21:54:17 -0000
@@ -299,19 +299,18 @@ function node_type_form_submit($form, &$
 
   // Save or reset persistent variable values.
   foreach ($variables as $key => $value) {
-    $key .= '_'. $type->type;
+    $key_type = $key .'_'. $type->type;
     if ($op == t('Reset to defaults')) {
-      variable_del($key);
+      variable_del($key_type);
     }
     else {
       if (is_array($value)) {
         $value = array_keys(array_filter($value));
       }
-      variable_set($key, $value);
+      variable_set($key_type, $value);
 
       if ($type->old_type != $type->type) {
-        $key = str_replace($type->type, $type->old_type, $key);
-        variable_del($key);
+        variable_del($key .'_'. $type->old_type);
       }
     }
   }
