diff --git a/strongarm.admin.inc b/strongarm.admin.inc
index 6a43b4b..033c9c8 100644
--- a/strongarm.admin.inc
+++ b/strongarm.admin.inc
@@ -1,4 +1,5 @@
 <?php
+// $Id: strongarm.admin.inc,v 1.1.2.2.2.5 2010/08/04 22:53:54 yhahn Exp $
 
 /**
  * Variable management strongarm form.
@@ -14,20 +15,29 @@ function strongarm_admin_form($form_state) {
       // If variable value does not match global $conf, this value has been
       // hardcoded (e.g. in settings.php) and has been allowed to pass
       // through. It cannot be reverted.
-      if ($conf[$name] !== $variable->value) {
-        $storage = t('Hardcoded');
-        $hardcoded = TRUE;
+
+      if (isset($variable->in_code_only)) {
+        $storage = t('In code');
       }
       else {
-        $storage = ($variable->value == $default->value) ? t('Default') : t('Overridden');
-        $hardcoded = FALSE;
+        $storage = t('Saved to DB');
       }
-
+      if ($variable->value != $default->value) { 
+        $storage = t('Overridden');
+      }
+      $hardcoded = FALSE;
+      
       // If the variable is in the database and differs from its code value,
       // allow administrator to revert its value.
       if (!$hardcoded && ($variable->export_type & EXPORT_IN_DATABASE) && ($variable->value != $default->value)) {
         $form['revert']['#tree'] = TRUE;
-        $form['revert'][$name] = array('#type' => 'checkbox');
+        $form['revert'][$name]['revert'] = array('#type' => 'checkbox');
+        $form['revert'][$name]['value'] = array('#type' => 'value', '#value' => $default->value);
+      }
+      else if (!$hardcoded && isset($variable->in_code_only)) {
+        $form['revert']['#tree'] = TRUE;
+        $form['revert'][$name]['revert'] = array('#type' => 'checkbox');
+        $form['revert'][$name]['value'] = array('#type' => 'value', '#value' => $default->value);
       }
       $form['name'][$name] = array(
         '#type' => 'markup',
@@ -46,7 +56,7 @@ function strongarm_admin_form($form_state) {
   if (!empty($form['revert'])) {
     $form['submit'] = array(
       '#type' => 'submit',
-      '#value' => t('Reset to defaults'),
+      '#value' => t('Restore values to DB'),
       '#submit' => array('strongarm_admin_revert_submit'),
     );
   }
@@ -59,8 +69,8 @@ function strongarm_admin_form($form_state) {
 function strongarm_admin_revert_submit(&$form, &$form_state) {
   if (!empty($form_state['values']['revert'])) {
     foreach ($form_state['values']['revert'] as $name => $revert) {
-      if ($revert) {
-        variable_del($name);
+      if ($revert['revert']) {
+        variable_set($name, $revert['value']);
       }
     }
     strongarm_flush_caches();
diff --git a/strongarm.install b/strongarm.install
index 97172c4..f40bcdc 100644
--- a/strongarm.install
+++ b/strongarm.install
@@ -47,3 +47,21 @@ function strongarm_update_6201() {
   }
   return $ret;
 }
+
+/**
+ * Update 6202: Set all strongarm variables that are only set in code in the database.
+ */
+function strongarm_update_6202() {
+  $ret = array();
+  $variables = strongarm_vars_load();
+  if (!empty($variables)) {
+    foreach ($variables as $var_name => $var) {
+      $exists = db_result(db_query("SELECT name FROM {variable} WHERE name = '%s'", $var_name));
+      if (!$exists) {
+        variable_set($var_name, $var->value);
+        $ret[] = array('success' => TRUE, 'query' => "Set strongarmed variable {$var_name} in the database.");
+      }
+    }
+  }
+  return $ret;
+}
diff --git a/strongarm.module b/strongarm.module
index 5618f18..1c12d05 100644
--- a/strongarm.module
+++ b/strongarm.module
@@ -1,77 +1,6 @@
 <?php
+// $Id: strongarm.module,v 1.1.2.6.2.17 2010/08/05 14:43:24 yhahn Exp $
 
-/**
- * Implementation of hook_init().
- */
-function strongarm_init() {
-  strongarm_set_conf();
-
-  // This is a workaround for the very early check of the 'site_frontpage'
-  // variable in the Drupal bootstrap process. The workaround re-runs
-  // drupal_init_path() to ensure the strongarm'ed version of
-  // 'site_frontpage' is used. Note that this may be too late if other modules
-  // weighted even lower than strongarm (which is a superlightweight -1000)
-  // rely on $_GET['q'] or 'site_frontpage' in hook_init().
-  $_GET['q'] = isset($_REQUEST['q']) ? strongarm_language_strip($_REQUEST['q']) : NULL;
-  drupal_init_path();
-}
-
-/**
- * Retrieve variable configuration from the cache.
- */
-function strongarm_set_conf($reset = FALSE) {
-  $varcache = cache_get('variables', 'cache');
-  $cache = cache_get('strongarm', 'cache');
-  // The > comparison here is cautious but ensures that the strongarm cache
-  // actually was populated after the variable cache. It is possible with
-  // >= for the var cache to be populated again during the same stale second.
-  if (!$reset && ($cache && $varcache && $cache->created > $varcache->created)) {
-    $var_conf = $cache->data;
-  }
-  else {
-    $var_conf = array();
-    foreach (strongarm_vars_load(FALSE, TRUE) as $var) {
-      $var_conf[$var->name] = $var->value;
-    }
-    cache_set('strongarm', $var_conf);
-  }
-  global $conf;
-
-  // Store the original variable values. This allows additional calls to
-  // strongarm_set_conf() to properly set Strongarm values.
-  static $original_conf;
-  if (!isset($original_conf)) {
-    $original_conf = $conf;
-  }
-
-  $conf = array_merge($var_conf, $original_conf);
-}
-
-/**
- * Remove the language prefix for a given path.
- * Strongarm implements this itself as language_initialize() directly affects
- * $_GET['q'] and cannot be reused.
- */
-function strongarm_language_strip($path) {
-  // Configured presentation language mode.
-  $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE);
-
-  // Get a list of enabled languages.
-  $languages = language_list('enabled');
-  $languages = $languages[1];
-
-  if (in_array($mode, array(LANGUAGE_NEGOTIATION_PATH_DEFAULT, LANGUAGE_NEGOTIATION_PATH))) {
-    $args = explode('/', $path);
-    $prefix = array_shift($args);
-    // Search prefix within enabled languages.
-    foreach ($languages as $language) {
-      if (!empty($language->prefix) && $language->prefix == $prefix) {
-        return implode('/', $args);
-      }
-    }
-  }
-  return $path;
-}
 
 /**
  * Implementation of hook_menu().
@@ -181,12 +110,45 @@ function strongarm_vars_load($sorted = TRUE, $reset = FALSE) {
  */
 if (!function_exists('variable_features_revert')) {
   function variable_features_revert($module) {
-    ctools_component_features_revert('variable', $module);
+    $defaults = features_get_default('variable', $module);
+    if (empty($defaults)) {
+      return;
+    }
+
+    $vars = strongarm_vars_load(TRUE, TRUE);
+    foreach ($defaults as $name => $default) {
+      if (isset($variable->in_code_only) || ($default->value != $vars[$name]->value)) {
+        variable_set($name, $default->value);
+      }
+    }
+
+    //ctools_component_features_revert('variable', $module);
     cache_clear_all('variables', 'cache');
   }
 }
 
 /**
+ * Implementation of hook_features_rebuild().
+ * Same as revert, but we only want to force variables only in code into the database
+ */
+function variable_features_rebuild($module) {
+  $defaults = features_get_default('variable', $module);
+  if (empty($defaults)) {
+    return;
+  }
+
+  $vars = strongarm_vars_load(TRUE, TRUE);
+  foreach ($defaults as $name => $default) {
+    if (isset($default->in_code_only)) {
+      variable_set($name, $default->value);
+    }
+  }
+
+  //ctools_component_features_revert('variable', $module);
+  cache_clear_all('variables', 'cache');
+}
+
+/**
  * Implementation of hook_features_pipe_alter() for node component.
  * Add node type variables on behalf of core modules.
  */
