diff --git a/sites/all/modules/contrib/radioactivity/radioactivity-bootstrap.inc b/sites/all/modules/contrib/radioactivity/radioactivity-bootstrap.inc
index 9b03915..0487660 100644
--- a/sites/all/modules/contrib/radioactivity/radioactivity-bootstrap.inc
+++ b/sites/all/modules/contrib/radioactivity/radioactivity-bootstrap.inc
@@ -79,8 +79,68 @@ function _radioactivity_require_bootstrapping() {
     }
 
     require_once './includes/bootstrap.inc';
-    drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES);
-    variable_set("radioactivity_bootstrap_warning", TRUE);
+    require_once './includes/path.inc';
+    require_once './includes/common.inc';
+    require_once './includes/module.inc';
+    require_once './includes/unicode.inc';
+    require_once './includes/file.inc';
+
+    // Do basic bootstrap to make sure the database can be accessed.
+    drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
+
+    // Prevent Devel from hi-jacking our output in any case.
+    $GLOBALS['devel_shutdown'] = FALSE;
+
+    // Detect string handling method.
+    unicode_check();
+
+    // Undo magic quotes.
+    fix_gpc_magic();
+
+    // Make sure all stream wrappers are registered.
+    file_get_stream_wrappers();
+
+    $dependencies = array('locale', 'node', 'field_sql_storage', 'field', 'radioactivity', 'system', 'entityreference');
+
+    // Load required modules.
+    $modules = array($module => 0);
+    foreach ($dependencies as $dependency) {
+      if (!drupal_load('module', $dependency)) {
+        // Do a boot up till SESSION to be sure the drupal_set_message()
+        // function works.
+        drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
+
+        // Create an error message with information for the user to be able
+        // to fix the dependency.
+        $error = t(
+          'The dependency :dependency is not installed.',
+          array(
+            ':dependency' => $dependency,
+          )
+        );
+
+        // Let the user know what's wrong and throw an exception to stop the
+        // callback.
+        drupal_set_message($error, 'error');
+        throw new Exception($error);
+      }
+      $modules[$dependency] = 0;
+    }
+
+    // Ensure the language variable is set, if not it might cause problems (e.g.
+    // entity info).
+    global $language;
+    if (!isset($language)) {
+      $language = language_default();
+    }
+    // Reset module list.
+    module_list(FALSE, TRUE, FALSE, $modules);
+
+    // Invoke implementations of hook_init()
+    module_invoke_all('init');
+
+    // drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES);
+    // variable_set("radioactivity_bootstrap_warning", TRUE);
   }
 }
 
diff --git a/sites/all/modules/contrib/radioactivity/radioactivity.module b/sites/all/modules/contrib/radioactivity/radioactivity.module
index 37e6955..952b6e7 100644
--- a/sites/all/modules/contrib/radioactivity/radioactivity.module
+++ b/sites/all/modules/contrib/radioactivity/radioactivity.module
@@ -257,29 +257,15 @@ function _radioactivity_update_energy(
   $force = FALSE
 ) {
 
-  $table_name = "field_data_" . $field_name;
-
-  $energy_column_name = $field_name . '_' . RADIOACTIVITY_FIELD_ENERGY;
-  $timestamp_column_name = $field_name . '_' . RADIOACTIVITY_FIELD_TIMESTAMP;
-
-  $q = db_merge($table_name)->key(array(
-    'entity_type' => $entity_type,
-    'bundle' => $bundle,
-    'entity_id' => $entity_id,
-    'language' => $language,
-    'delta' => 0,
-  ))->fields(array(
-    'revision_id' => $entity_id,
-    $timestamp_column_name => $time,
-    $energy_column_name => $energy_delta,
-  ));
-
-  if (!$force) {
-    // update instead of set the energy
-    $q->expression($energy_column_name, $energy_column_name . ' + :inc', array(':inc' => $energy_delta));
+  $node = node_load($entity_id);
+  $items = field_get_items('node', $node, $field_name);
+  foreach ($items as &$item) {
+    $item[RADIOACTIVITY_FIELD_ENERGY] = (string)($energy_delta + $item[RADIOACTIVITY_FIELD_ENERGY]);
+    $item[RADIOACTIVITY_FIELD_TIMESTAMP] = $time;
   }
 
-  $q->execute();
+  $node->{$field_name}[LANGUAGE_NONE] = $items;
+  node_save($node);
 }
 
 /**
