diff --git a/sites/all/modules/mollom/mollom.install b/sites/all/modules/mollom/mollom.install
index 0abeb82..52d47bf 100644
--- a/sites/all/modules/mollom/mollom.install
+++ b/sites/all/modules/mollom/mollom.install
@@ -700,7 +700,7 @@ function mollom_update_7005() {
 
   // Add {mollom}.spam.
   // When upgrading from 6.x-2.x, this is {mollom}.spamScore already.
-  if (!db_field_exists('mollom', 'spam') && !db_field_exists('mollom', 'spamScore')) {
+  if (!db_field_exists('mollom', 'spam') && !db_field_exists('mollom', 'spamScore') && !db_field_exists('mollom', 'spam_score')) {
     db_add_field('mollom', 'spam', array(
       'description' => 'Text analysis spam check result.',
       'type' => 'int',
@@ -711,25 +711,31 @@ function mollom_update_7005() {
     // Note that this is just to have some values. 'quality' and 'spam' are
     // completely unrelated otherwise.
     // MOLLOM_ANALYSIS_SPAM (2)
+
+    if (db_field_exists('mollom', 'quality')) {
+      $quality = 'quality';
+    } else {
+      $quality = 'quality_score';
+    }
     db_update('mollom')
       ->fields(array('spam' => 2))
-      ->condition('quality', 0.5, '<')
+      ->condition($quality, 0.5, '<')
       ->execute();
     // MOLLOM_ANALYSIS_UNSURE (3)
     db_update('mollom')
       ->fields(array('spam' => 3))
-      ->condition('quality', 0.5, '=')
+      ->condition($quality, 0.5, '=')
       ->execute();
     // MOLLOM_ANALYSIS_HAM (1)
     db_update('mollom')
       ->fields(array('spam' => 1))
-      ->condition('quality', 0.5, '>')
+      ->condition($quality, 0.5, '>')
       ->execute();
   }
 
   // Add {mollom}.profanity.
   // When upgrading from 6.x-2.x, this is {mollom}.profanityScore already.
-  if (!db_field_exists('mollom', 'profanity') && !db_field_exists('mollom', 'profanityScore')) {
+  if (!db_field_exists('mollom', 'profanity') && !db_field_exists('mollom', 'profanityScore') && !db_field_exists('mollom', 'profanity_score')) {
     db_add_field('mollom', 'profanity', array(
       'description' => 'Text analysis profanity check result.',
       'type' => 'float',
@@ -820,7 +826,7 @@ function mollom_update_7008() {
   }
 
   // When upgrading from 6.x-2.x, this is {mollom}.contentId already.
-  if (!db_field_exists('mollom', 'session_id') && !db_field_exists('mollom', 'contentId')) {
+  if (db_field_exists('mollom', 'session') && !db_field_exists('mollom', 'session_id') && !db_field_exists('mollom', 'contentId')) {
     db_drop_index('mollom', 'session');
     db_change_field('mollom', 'session', 'session_id', array(
       'description' => 'Session hash returned by Mollom.',
@@ -921,7 +927,7 @@ function mollom_update_7200() {
     db_add_index('mollom', 'captchaId', array('captchaId'));
   }
   // Add 'spamClassification'.
-  if (!db_field_exists('mollom', 'spamClassification')) {
+  if (!db_field_exists('mollom', 'spamClassification') && !db_field_exists('mollom', 'spam_classification')) {
     db_add_field('mollom', 'spamClassification', array(
       'description' => 'Text analysis final spam classification result.',
       'type' => 'varchar',
@@ -930,7 +936,7 @@ function mollom_update_7200() {
     ));
   }
   // Change 'spam' into 'spamScore' double.
-  if (!db_field_exists('mollom', 'spamScore')) {
+  if (db_field_exists('mollom', spam) && !db_field_exists('mollom', 'spamScore')) {
     db_change_field('mollom', 'spam', 'spamScore', array(
       'description' => 'Text analysis spam check result.',
       'type' => 'float',
@@ -939,7 +945,7 @@ function mollom_update_7200() {
     ));
   }
   // Change 'profanity' into 'profanityScore' double.
-  if (!db_field_exists('mollom', 'profanityScore')) {
+  if (db_field_exists('mollom', 'profanity') && !db_field_exists('mollom', 'profanityScore') && !db_field_exists('mollom', 'profanity_score')) {
     db_change_field('mollom', 'profanity', 'profanityScore', array(
       'description' => 'Text analysis profanity check result.',
       'type' => 'float',
@@ -948,7 +954,7 @@ function mollom_update_7200() {
     ));
   }
   // Change 'quality' into 'qualityScore' double.
-  if (!db_field_exists('mollom', 'qualityScore')) {
+  if (db_field_exists('mollom', 'quality') && !db_field_exists('mollom', 'qualityScore') && !db_field_exists('mollom', 'quality_score')) {
     db_change_field('mollom', 'quality', 'qualityScore', array(
       'description' => 'Text analysis quality check result.',
       'type' => 'float',
@@ -1031,12 +1037,23 @@ function mollom_update_7204() {
   drupal_load('module', 'mollom');
 
   // Find all Mollom data records with duplicate contentIds.
-  $contentIds = mollom_db_query('SELECT contentId FROM {mollom} GROUP BY contentId HAVING COUNT(contentId) > 1')->fetchCol();
-  // If there are any, delete them.
-  if (!empty($contentIds)) {
-    db_delete('mollom')
-      ->condition('contentId', $contentIds)
-      ->execute();
+  if (db_field_exists('mollom', 'contentId')) {
+    $contentIds = mollom_db_query('SELECT contentId FROM {mollom} GROUP BY contentId HAVING COUNT(contentId) > 1')->fetchCol();
+    // If there are any, delete them.
+    if (!empty($contentIds)) {
+      db_delete('mollom')
+        ->condition('contentId', $contentIds)
+        ->execute();
+    }
+  }
+  else {
+    $content_ids = mollom_db_query('SELECT content_id FROM {mollom} GROUP BY content_id HAVING COUNT(content_id) > 1')->fetchCol();
+    // If there are any, delete them.
+    if (!empty($content_ids)) {
+      db_delete('mollom')
+        ->condition('content_id', $content_ids)
+        ->execute();
+    }
   }
 }
 
@@ -1222,9 +1239,8 @@ function mollom_update_7212() {
  * Change all mixedCase database columns and indexes to underscore separated.
  */
 function mollom_update_7213() {
-  db_drop_index('mollom', 'contentId');
-  db_drop_index('mollom', 'captchaId');
   if (db_field_exists('mollom', 'contentId')) {
+    db_drop_index('mollom', 'contentId');
     db_change_field('mollom', 'contentId', 'content_id', array(
       'description' => 'Content ID returned by Mollom.',
       'type' => 'varchar',
@@ -1232,13 +1248,16 @@ function mollom_update_7213() {
       'not null' => TRUE,
       'default' => '',
     ));
+    db_add_index('mollom', 'content_id', array('content_id'));
   }
   if (db_field_exists('mollom', 'captchaId')) {
+    db_drop_index('mollom', 'captchaId');
     db_change_field('mollom', 'captchaId', 'captcha_id', array(
       'description' => 'CAPTCHA ID returned by Mollom.',
       'type' => 'varchar',
       'length' => 128,
     ));
+    db_add_index('mollom', 'captcha_id', array('captcha_id'));
   }
   if (db_field_exists('mollom', 'spamScore')) {
     db_change_field('mollom', 'spamScore', 'spam_score', array(
@@ -1271,6 +1290,4 @@ function mollom_update_7213() {
       'not null' => FALSE,
     ));
   }
-  db_add_index('mollom', 'content_id', array('content_id'));
-  db_add_index('mollom', 'captcha_id', array('captcha_id'));
 }
