diff --git a/mollom.module b/mollom.module
index 95f9468..d08bfef 100644
--- a/mollom.module
+++ b/mollom.module
@@ -35,19 +35,19 @@ define('MOLLOM_FALLBACK_ACCEPT', 1);
  */
 function mollom_hook_info() {
   $hooks = array(
-    'mollom_form_list',
-    'mollom_form_list_alter',
-    'mollom_form_info',
-    'mollom_form_info_alter',
-    'mollom_form_insert',
-    'mollom_form_update',
-    'mollom_form_delete',
-    'mollom_data_insert',
-    'mollom_data_update',
-    'mollom_data_delete',
+      'mollom_form_list',
+      'mollom_form_list_alter',
+      'mollom_form_info',
+      'mollom_form_info_alter',
+      'mollom_form_insert',
+      'mollom_form_update',
+      'mollom_form_delete',
+      'mollom_data_insert',
+      'mollom_data_update',
+      'mollom_data_delete',
   );
   $hooks = array_fill_keys($hooks, array(
-    'group' => 'mollom',
+      'group' => 'mollom',
   ));
   return $hooks;
 }
@@ -61,12 +61,12 @@ function mollom_help($path, $arg) {
   if ($path == 'admin/config/content/mollom') {
     $output .= '<p>';
     $output .= t('All listed forms below are protected by Mollom, unless users are able to <a href="@permissions-url">bypass Mollom\'s protection</a>.', array(
-      '@permissions-url' => url('admin/people/permissions', array('fragment' => 'module-mollom')),
+        '@permissions-url' => url('admin/people/permissions', array('fragment' => 'module-mollom')),
     ));
     $output .= '</p>';
     $output .= '<p>';
     $output .= t('You can <a href="@add-form-url">add a form</a> to protect, configure already protected forms, or remove the protection.', array(
-      '@add-form-url' => url('admin/config/content/mollom/add'),
+        '@add-form-url' => url('admin/config/content/mollom/add'),
     ));
     $output .= '</p>';
     return $output;
@@ -79,10 +79,10 @@ function mollom_help($path, $arg) {
   if ($path == 'admin/help#mollom') {
     $output = '<p>';
     $output .= t("Allowing users to react, participate and contribute while still keeping your site's content under control can be a huge challenge. Mollom is a web service that helps you identify content quality and, more importantly, helps you stop spam. When content moderation becomes easier, you have more time and energy to interact with your web community. More information about Mollom is available on the <a href=\"@mollom-website\">Mollom website</a> or in the <a href=\"@mollom-faq\">Mollom FAQ</a>.",
-      array(
-        '@mollom-website' => 'http://mollom.com',
-        '@mollom-faq' => 'http://mollom.com/faq',
-      )
+        array(
+            '@mollom-website' => 'http://mollom.com',
+            '@mollom-faq' => 'http://mollom.com/faq',
+        )
     );
     $output .= '</p><p>';
     $output .= t("Mollom can be used to block all types of spam received on your website's protected forms. Each form can be set to one of the following options:");
@@ -92,9 +92,9 @@ function mollom_help($path, $arg) {
     $output .= t("<strong>CAPTCHA only</strong>: the form's data is not sent to Mollom for analysis, and a remotely-hosted CAPTCHA challenge is always presented. This option is useful when you wish to always display a CAPTCHA or want to send less data to the Mollom network. Note, however, that forms displayed with a CAPTCHA are never cached, so always displaying a CAPTCHA challenge may reduce performance.");
     $output .= '</li></ul><p>';
     $output .= t("Data is processed and stored as explained in our <a href=\"@mollom-privacy\">Web Service Privacy Policy</a>. It is your responsibility to provide any necessary notices and obtain the appropriate consent regarding Mollom's use of your data. For more information, see <a href=\"@mollom-works\">How Mollom Works</a> and the <a href=\"@mollom-faq\">Mollom FAQ</a>.", array(
-      '@mollom-privacy' => 'http://mollom.com/service-agreement-free-subscriptions',
-      '@mollom-works' => 'http://mollom.com/how-mollom-works',
-      '@mollom-faq' => 'http://mollom.com/faq')
+        '@mollom-privacy' => 'http://mollom.com/service-agreement-free-subscriptions',
+        '@mollom-works' => 'http://mollom.com/how-mollom-works',
+        '@mollom-faq' => 'http://mollom.com/faq')
     );
     $output .= '</p>';
     $output .= '<p>';
@@ -111,12 +111,12 @@ function mollom_help($path, $arg) {
     $output .= t("If a blacklist entry contains multiple words, various combinations will be matched. For example, when adding \"<code>replica&nbsp;watches</code>\" limited to links, the following links will be blocked:");
     $output .= '</p>';
     $output .= '<ul>
-<li><code>http://replica-watches.com</code></li>
-<li><code>http://replica-watches.com/some/path</code></li>
-<li><code>http://replicawatches.net</code></li>
-<li><code>http://example.com/replica/watches</code></li>
-<li><code>&lt;a href="http://example.com"&gt;replica watches&lt;/a&gt;</code></li>
-</ul>';
+    <li><code>http://replica-watches.com</code></li>
+    <li><code>http://replica-watches.com/some/path</code></li>
+    <li><code>http://replicawatches.net</code></li>
+    <li><code>http://example.com/replica/watches</code></li>
+    <li><code>&lt;a href="http://example.com"&gt;replica watches&lt;/a&gt;</code></li>
+    </ul>';
     $output .= '<p>';
     $output .= t("The blacklist is optional. There is no whitelist, i.e., if a blacklist entry is matched in a post, it overrides any other filter result and the post will not be accepted. Blacklisting potentially ambiguous words should be avoided.");
     $output .= '</p>';
@@ -163,124 +163,124 @@ function mollom_exit() {
  */
 function mollom_menu() {
   $items['mollom/report/%/%'] = array(
-    'title' => 'Report to Mollom',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_report_form', 2, 3),
-    'access callback' => 'mollom_report_access',
-    'access arguments' => array(2, 3),
-    'file' => 'mollom.pages.inc',
-    'type' => MENU_CALLBACK,
+      'title' => 'Report to Mollom',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_report_form', 2, 3),
+      'access callback' => 'mollom_report_access',
+      'access arguments' => array(2, 3),
+      'file' => 'mollom.pages.inc',
+      'type' => MENU_CALLBACK,
   );
   $items['mollom/moderate/%mollom_content/%'] = array(
-    'page callback' => 'mollom_moderate',
-    'page arguments' => array(2, 3),
-    'access callback' => 'mollom_moderate_access',
-    'access arguments' => array(2, 3),
-    'type' => MENU_CALLBACK,
+      'page callback' => 'mollom_moderate',
+      'page arguments' => array(2, 3),
+      'access callback' => 'mollom_moderate_access',
+      'access arguments' => array(2, 3),
+      'type' => MENU_CALLBACK,
   );
 
   $items['admin/config/content/mollom'] = array(
-    'title' => 'Mollom content moderation',
-    'description' => 'Configure how the Mollom service moderates user-submitted content such as spam and profanity.',
-    'page callback' => 'mollom_admin_form_list',
-    'access arguments' => array('administer mollom'),
-    'file' => 'mollom.admin.inc',
+      'title' => 'Mollom content moderation',
+      'description' => 'Configure how the Mollom service moderates user-submitted content such as spam and profanity.',
+      'page callback' => 'mollom_admin_form_list',
+      'access arguments' => array('administer mollom'),
+      'file' => 'mollom.admin.inc',
   );
   $items['admin/config/content/mollom/forms'] = array(
-    'title' => 'Forms',
-    'type' => MENU_DEFAULT_LOCAL_TASK,
-    'weight' => -10,
+      'title' => 'Forms',
+      'type' => MENU_DEFAULT_LOCAL_TASK,
+      'weight' => -10,
   );
   $items['admin/config/content/mollom/add'] = array(
-    'title' => 'Add form',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_configure_form'),
-    'access arguments' => array('administer mollom'),
-    'type' => MENU_LOCAL_ACTION,
-    'file' => 'mollom.admin.inc',
+      'title' => 'Add form',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_admin_configure_form'),
+      'access arguments' => array('administer mollom'),
+      'type' => MENU_LOCAL_ACTION,
+      'file' => 'mollom.admin.inc',
   );
   $items['admin/config/content/mollom/manage/%mollom_form'] = array(
-    'title' => 'Configure',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_configure_form', 5),
-    'access arguments' => array('administer mollom'),
-    'file' => 'mollom.admin.inc',
+      'title' => 'Configure',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_admin_configure_form', 5),
+      'access arguments' => array('administer mollom'),
+      'file' => 'mollom.admin.inc',
   );
   $items['admin/config/content/mollom/unprotect/%mollom_form'] = array(
-    'title' => 'Unprotect form',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_unprotect_form', 5),
-    'access arguments' => array('administer mollom'),
-    'file' => 'mollom.admin.inc',
+      'title' => 'Unprotect form',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_admin_unprotect_form', 5),
+      'access arguments' => array('administer mollom'),
+      'file' => 'mollom.admin.inc',
   );
   $items['admin/config/content/mollom/blacklist'] = array(
-    'title' => 'Blacklists',
-    'description' => 'Configure blacklists.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_blacklist_form'),
-    'access arguments' => array('administer mollom'),
-    'type' => MENU_LOCAL_TASK,
-    'file' => 'mollom.admin.inc',
+      'title' => 'Blacklists',
+      'description' => 'Configure blacklists.',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_admin_blacklist_form'),
+      'access arguments' => array('administer mollom'),
+      'type' => MENU_LOCAL_TASK,
+      'file' => 'mollom.admin.inc',
   );
   $items['admin/config/content/mollom/blacklist/spam'] = array(
-    'title' => 'Spam',
-    'description' => 'Configure spam blacklist entries.',
-    'type' => MENU_DEFAULT_LOCAL_TASK,
-    'weight' => -10,
+      'title' => 'Spam',
+      'description' => 'Configure spam blacklist entries.',
+      'type' => MENU_DEFAULT_LOCAL_TASK,
+      'weight' => -10,
   );
   $items['admin/config/content/mollom/blacklist/profanity'] = array(
-    'title' => 'Profanity',
-    'description' => 'Configure profanity blacklist entries.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_blacklist_form', 5),
-    'access arguments' => array('administer mollom'),
-    'type' => MENU_LOCAL_TASK,
-    'file' => 'mollom.admin.inc',
+      'title' => 'Profanity',
+      'description' => 'Configure profanity blacklist entries.',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_admin_blacklist_form', 5),
+      'access arguments' => array('administer mollom'),
+      'type' => MENU_LOCAL_TASK,
+      'file' => 'mollom.admin.inc',
   );
   $items['admin/config/content/mollom/blacklist/unwanted'] = array(
-    'title' => 'Unwanted',
-    'description' => 'Configure unwanted blacklist entries.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_blacklist_form', 5),
-    'access arguments' => array('administer mollom'),
-    'type' => MENU_LOCAL_TASK,
-    'file' => 'mollom.admin.inc',
+      'title' => 'Unwanted',
+      'description' => 'Configure unwanted blacklist entries.',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_admin_blacklist_form', 5),
+      'access arguments' => array('administer mollom'),
+      'type' => MENU_LOCAL_TASK,
+      'file' => 'mollom.admin.inc',
   );
   $items['admin/config/content/mollom/blacklist/delete/%'] = array(
-    'title' => 'Delete',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_blacklist_delete', 6),
-    'access arguments' => array('administer mollom'),
-    'type' => MENU_CALLBACK,
-    'file' => 'mollom.admin.inc',
+      'title' => 'Delete',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_admin_blacklist_delete', 6),
+      'access arguments' => array('administer mollom'),
+      'type' => MENU_CALLBACK,
+      'file' => 'mollom.admin.inc',
   );
   $items['admin/config/content/mollom/settings'] = array(
-    'title' => 'Settings',
-    'description' => 'Configure Mollom keys and global settings.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_settings'),
-    'access arguments' => array('administer mollom'),
-    'type' => MENU_LOCAL_TASK,
-    'file' => 'mollom.admin.inc',
+      'title' => 'Settings',
+      'description' => 'Configure Mollom keys and global settings.',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_admin_settings'),
+      'access arguments' => array('administer mollom'),
+      'type' => MENU_LOCAL_TASK,
+      'file' => 'mollom.admin.inc',
   );
 
   $items['admin/reports/mollom'] = array(
-    'title' => 'Mollom statistics',
-    'description' => 'Reports and usage statistics for the Mollom module.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_reports_page'),
-    'access callback' => '_mollom_access',
-    'access arguments' => array('access mollom statistics'),
-    'file' => 'mollom.admin.inc',
+      'title' => 'Mollom statistics',
+      'description' => 'Reports and usage statistics for the Mollom module.',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('mollom_reports_page'),
+      'access callback' => '_mollom_access',
+      'access arguments' => array('access mollom statistics'),
+      'file' => 'mollom.admin.inc',
   );
 
   // AJAX callback to request new CAPTCHA.
   $items['mollom/captcha/%/%'] = array(
-    'page callback' => 'mollom_captcha_js',
-    'page arguments' => array(2, 3),
-    'access callback' => '_mollom_access',
-    'file' => 'mollom.pages.inc',
-    'type' => MENU_CALLBACK,
+      'page callback' => 'mollom_captcha_js',
+      'page arguments' => array(2, 3),
+      'access callback' => '_mollom_access',
+      'file' => 'mollom.pages.inc',
+      'type' => MENU_CALLBACK,
   );
 
   return $items;
@@ -360,15 +360,15 @@ function mollom_report_access($entity, $id) {
  */
 function mollom_permission() {
   return array(
-    'administer mollom' => array(
-      'title' => t('Administer Mollom-protected forms and Mollom settings'),
-    ),
-    'bypass mollom protection' => array(
-      'title' => t('Bypass Mollom protection on forms'),
-    ),
-    'access mollom statistics' => array(
-      'title' => t('View Mollom statistics'),
-    ),
+      'administer mollom' => array(
+          'title' => t('Administer Mollom-protected forms and Mollom settings'),
+      ),
+      'bypass mollom protection' => array(
+          'title' => t('Bypass Mollom protection on forms'),
+      ),
+      'access mollom statistics' => array(
+          'title' => t('View Mollom statistics'),
+      ),
   );
 }
 
@@ -393,8 +393,8 @@ function mollom_cron() {
   // Mollom session data auto-expires after 6 months.
   $expired = REQUEST_TIME - 86400 * 30 * 6;
   db_delete('mollom')
-    ->condition('changed', $expired, '<')
-    ->execute();
+  ->condition('changed', $expired, '<')
+  ->execute();
 }
 
 /**
@@ -508,8 +508,8 @@ function mollom_data_save($data) {
   }
 
   $update = db_query_range("SELECT 'id' FROM {mollom} WHERE entity = :entity AND id = :id", 0, 1, array(
-    ':entity' => $data->entity,
-    ':id' => $data->id,
+      ':entity' => $data->entity,
+      ':id' => $data->id,
   ))->fetchField();
   drupal_write_record('mollom', $data, $update ? array('entity', $update) : array());
 
@@ -584,21 +584,21 @@ function mollom_data_delete_form_alter(&$form, &$form_state) {
     $form['description']['#weight'] = 90;
   }
   $form['mollom'] = array(
-    '#tree' => TRUE,
-    '#weight' => 80,
+      '#tree' => TRUE,
+      '#weight' => 80,
   );
   $form['mollom']['feedback'] = array(
-    '#type' => 'radios',
-    '#title' => t('Report as inappropriate'),
-    '#options' => array(
-      '' => t('Do not report'),
-      'spam' => t('Spam, unsolicited advertising'),
-      'profanity' => t('Obscene, violent, profane'),
-      'quality' => t('Low-quality'),
-      'unwanted' => t('Unwanted, taunting, off-topic'),
-    ),
-    '#default_value' => '',
-    '#description' => t('Sending feedback to <a href="@mollom-url">Mollom</a> improves the automated moderation of new submissions.', array('@mollom-url' => 'http://mollom.com')),
+      '#type' => 'radios',
+      '#title' => t('Report as inappropriate'),
+      '#options' => array(
+          '' => t('Do not report'),
+          'spam' => t('Spam, unsolicited advertising'),
+          'profanity' => t('Obscene, violent, profane'),
+          'quality' => t('Low-quality'),
+          'unwanted' => t('Unwanted, taunting, off-topic'),
+      ),
+      '#default_value' => '',
+      '#description' => t('Sending feedback to <a href="@mollom-url">Mollom</a> improves the automated moderation of new submissions.', array('@mollom-url' => 'http://mollom.com')),
   );
 }
 
@@ -696,11 +696,11 @@ function mollom_form_alter(&$form, &$form_state, $form_id) {
       }
       // Add Mollom form widget.
       $form['mollom'] = array(
-        '#type' => 'mollom',
-        '#mollom_form' => $mollom_form,
-        // #type 'actions' defaults to 100.
-        '#weight' => (isset($form['actions']['#weight']) ? $form['actions']['#weight'] - 1 : 99),
-        '#tree' => TRUE,
+          '#type' => 'mollom',
+          '#mollom_form' => $mollom_form,
+          // #type 'actions' defaults to 100.
+          '#weight' => (isset($form['actions']['#weight']) ? $form['actions']['#weight'] - 1 : 99),
+          '#tree' => TRUE,
       );
       // Enable caching of this form; required for our form validation and
       // submit handlers.
@@ -736,12 +736,12 @@ function mollom_form_alter(&$form, &$form_state, $form_id) {
       // if enabled.
       if ($mollom_form['mode'] == MOLLOM_MODE_ANALYSIS && variable_get('mollom_privacy_link', 1)) {
         $form['mollom']['privacy'] = array(
-          '#prefix' => '<div class="description mollom-privacy">',
-          '#suffix' => '</div>',
-          '#markup' => t('By submitting this form, you accept the <a href="@privacy-policy-url">Mollom privacy policy</a>.', array(
-            '@privacy-policy-url' => 'http://mollom.com/web-service-privacy-policy',
-          )),
-          '#weight' => 10,
+            '#prefix' => '<div class="description mollom-privacy">',
+            '#suffix' => '</div>',
+            '#markup' => t('By submitting this form, you accept the <a href="@privacy-policy-url">Mollom privacy policy</a>.', array(
+                '@privacy-policy-url' => 'http://mollom.com/web-service-privacy-policy',
+            )),
+            '#weight' => 10,
         );
       }
     }
@@ -858,8 +858,8 @@ function mollom_form_list() {
     foreach ($module_forms as $form_id => $info) {
       $form_list[$form_id] = $info;
       $form_list[$form_id] += array(
-        'form_id' => $form_id,
-        'module' => $module,
+          'form_id' => $form_id,
+          'module' => $module,
       );
     }
   }
@@ -886,23 +886,23 @@ function mollom_form_info($form_id, $module) {
 
   // Ensure default properties.
   $form_info += array(
-    // Base properties.
-    'form_id' => $form_id,
-    'title' => $form_id,
-    'module' => $module,
-    'entity' => NULL,
-    // Configuration properties.
-    'mode' => NULL,
-    'checks' => array(),
-    'enabled_fields' => array(),
-    'strictness' => 'normal',
-    'discard' => 1,
-    'moderation' => 0,
-    // Meta information.
-    'bypass access' => array(),
-    'elements' => array(),
-    'mapping' => array(),
-    'mail ids' => array(),
+      // Base properties.
+      'form_id' => $form_id,
+      'title' => $form_id,
+      'module' => $module,
+      'entity' => NULL,
+      // Configuration properties.
+      'mode' => NULL,
+      'checks' => array(),
+      'enabled_fields' => array(),
+      'strictness' => 'normal',
+      'discard' => 1,
+      'moderation' => 0,
+      // Meta information.
+      'bypass access' => array(),
+      'elements' => array(),
+      'mapping' => array(),
+      'mail ids' => array(),
   );
 
   // Allow modules to alter the default form information.
@@ -989,8 +989,8 @@ function mollom_form_delete($form_id) {
   $mollom_form = mollom_form_load($form_id);
 
   db_delete('mollom_form')
-    ->condition('form_id', $form_id)
-    ->execute();
+  ->condition('form_id', $form_id)
+  ->execute();
 
   // Allow modules to react on saved form configurations.
   module_invoke_all('mollom_form_delete', $mollom_form);
@@ -1220,9 +1220,9 @@ function mollom_form_get_values(&$form_state, $fields, $mapping) {
   if ($invalid_utf8 || $invalid_xml) {
     form_set_error('', t('Your submission contains invalid characters and will not be accepted.'));
     mollom_log(array(
-      'message' => 'Invalid !type in form values',
-      'arguments' => array('!type' => $invalid_utf8 ? 'UTF-8' : 'XML characters'),
-      'Data:' => $data,
+        'message' => 'Invalid !type in form values',
+        'arguments' => array('!type' => $invalid_utf8 ? 'UTF-8' : 'XML characters'),
+        'Data:' => $data,
     ), WATCHDOG_WARNING);
     $data = FALSE;
   }
@@ -1284,8 +1284,8 @@ function _mollom_get_openid($account) {
 function _mollom_status($reset = FALSE) {
   // Load stored status.
   $status = variable_get('mollom_status', array(
-    'keys' => FALSE,
-    'keys valid' => FALSE,
+      'keys' => FALSE,
+      'keys valid' => FALSE,
   ));
   $current_status = $status;
 
@@ -1301,7 +1301,7 @@ function _mollom_status($reset = FALSE) {
     $status['keys valid'] = $mollom->verifyKeys();
     if ($status['keys valid'] === TRUE) {
       mollom_log(array(
-        'message' => 'API keys are valid.',
+          'message' => 'API keys are valid.',
       ), WATCHDOG_INFO);
     }
     // If the response is neither positive nor a negative authentication error,
@@ -1315,12 +1315,12 @@ function _mollom_status($reset = FALSE) {
       // caused by the server-side failure.
       $reset = FALSE;
       mollom_log(array(
-        'message' => 'API keys could not be verified.',
+          'message' => 'API keys could not be verified.',
       ), WATCHDOG_WARNING);
     }
     else {
       mollom_log(array(
-        'message' => 'Invalid API keys.',
+          'message' => 'Invalid API keys.',
       ), WATCHDOG_ERROR);
     }
   }
@@ -1355,11 +1355,11 @@ function _mollom_testing_mode_warning() {
     $admin_message = '';
     if (user_access('administer mollom') && $_GET['q'] != 'admin/config/content/mollom/settings') {
       $admin_message = t('Visit the <a href="@settings-url">Mollom settings page</a> to disable it.', array(
-        '@settings-url' => url('admin/config/content/mollom/settings'),
+          '@settings-url' => url('admin/config/content/mollom/settings'),
       ));
     }
     $message = t('Mollom testing mode is still enabled. !admin-message', array(
-      '!admin-message' => $admin_message,
+        '!admin-message' => $admin_message,
     ));
     drupal_set_message($message, 'warning');
   }
@@ -1404,11 +1404,11 @@ function _mollom_fallback() {
  */
 function mollom_element_info() {
   return array(
-    'mollom' => array(
-      '#process' => array(
-        'mollom_process_mollom',
+      'mollom' => array(
+          '#process' => array(
+              'mollom_process_mollom',
+          ),
       ),
-    ),
   );
 }
 
@@ -1417,10 +1417,10 @@ function mollom_element_info() {
  */
 function mollom_theme() {
   return array(
-    'mollom_admin_blacklist_form' => array(
-      'render element' => 'form',
-      'file' => 'mollom.admin.inc',
-    ),
+      'mollom_admin_blacklist_form' => array(
+          'render element' => 'form',
+          'file' => 'mollom.admin.inc',
+      ),
   );
 }
 
@@ -1435,13 +1435,13 @@ function mollom_process_mollom($element, &$form_state, $complete_form) {
   // Setup initial Mollom session and form information.
   $form_state += array('mollom' => array());
   $form_state['mollom'] += array(
-    'require_analysis' => $element['#mollom_form']['mode'] == MOLLOM_MODE_ANALYSIS,
-    'require_captcha' => $element['#mollom_form']['mode'] == MOLLOM_MODE_CAPTCHA,
-    'passed_captcha' => FALSE,
-    'captcha_type' => 'image',
-    'require_moderation' => FALSE,
-    'response' => array(
-    ),
+      'require_analysis' => $element['#mollom_form']['mode'] == MOLLOM_MODE_ANALYSIS,
+      'require_captcha' => $element['#mollom_form']['mode'] == MOLLOM_MODE_CAPTCHA,
+      'passed_captcha' => FALSE,
+      'captcha_type' => 'image',
+      'require_moderation' => FALSE,
+      'response' => array(
+      ),
   );
   // Instantiate a new Mollom class, unless there is not a cached one.
   if (!isset($form_state['mollom']['class'])) {
@@ -1462,23 +1462,23 @@ function mollom_process_mollom($element, &$form_state, $complete_form) {
 
   // Add the Mollom session elements.
   $element['contentId'] = array(
-    '#type' => 'hidden',
-    '#default_value' => isset($form_state['mollom']['response']['content']['id']) ? $form_state['mollom']['response']['content']['id'] : '',
-    '#attributes' => array('class' => 'mollom-content-id'),
+      '#type' => 'hidden',
+      '#default_value' => isset($form_state['mollom']['response']['content']['id']) ? $form_state['mollom']['response']['content']['id'] : '',
+      '#attributes' => array('class' => 'mollom-content-id'),
   );
   $element['captchaId'] = array(
-    '#type' => 'hidden',
-    '#default_value' => isset($form_state['mollom']['response']['captcha']['id']) ? $form_state['mollom']['response']['captcha']['id'] : '',
-    '#attributes' => array('class' => 'mollom-captcha-id'),
+      '#type' => 'hidden',
+      '#default_value' => isset($form_state['mollom']['response']['captcha']['id']) ? $form_state['mollom']['response']['captcha']['id'] : '',
+      '#attributes' => array('class' => 'mollom-captcha-id'),
   );
 
   // Add the CAPTCHA element.
   $element['captcha'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Word verification'),
-    '#size' => 10,
-    '#default_value' => '',
-    '#description' => t("Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive."),
+      '#type' => 'textfield',
+      '#title' => t('Word verification'),
+      '#size' => 10,
+      '#default_value' => '',
+      '#description' => t("Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive."),
   );
   // Disable browser autocompletion, unless testing mode is enabled, in which
   // case autocompletion for 'correct' and 'incorrect' is handy.
@@ -1497,21 +1497,21 @@ function mollom_process_mollom($element, &$form_state, $complete_form) {
 
   // Add a spambot trap. Purposively use 'homepage' as field name.
   $element['homepage'] = array(
-    '#type' => 'textfield',
-    // Wrap the entire honeypot form element markup into a hidden container, so
-    // robots cannot simply check for a style attribute, but instead have to
-    // implement advanced DOM processing to figure out whether they are dealing
-    // with a honeypot field.
-    '#prefix' => '<div style="display: none;">',
-    '#suffix' => '</div>',
-    // Although this input is hidden and not visible to screen readers,
-    // accessibility validators (such as WAVE) would still complain about a form
-    // field without any kind of legend/label. t() is needless here.
-    '#attributes' => array(
-      'title' => 'Homepage',
-      // Disable browser autocompletion.
-      'autocomplete' => 'off',
-    ),
+      '#type' => 'textfield',
+      // Wrap the entire honeypot form element markup into a hidden container, so
+      // robots cannot simply check for a style attribute, but instead have to
+      // implement advanced DOM processing to figure out whether they are dealing
+      // with a honeypot field.
+      '#prefix' => '<div style="display: none;">',
+      '#suffix' => '</div>',
+      // Although this input is hidden and not visible to screen readers,
+      // accessibility validators (such as WAVE) would still complain about a form
+      // field without any kind of legend/label. t() is needless here.
+      '#attributes' => array(
+          'title' => 'Homepage',
+          // Disable browser autocompletion.
+          'autocomplete' => 'off',
+      ),
   );
 
   // Make Mollom form and session information available to entirely different
@@ -1623,8 +1623,8 @@ function mollom_validate_analysis(&$form, &$form_state) {
       $form_state['mollom']['require_moderation'] = TRUE;
     }
     mollom_log(array(
-      'message' => 'Profanity: %teaser',
-      'arguments' => array('%teaser' => $teaser),
+        'message' => 'Profanity: %teaser',
+        'arguments' => array('%teaser' => $teaser),
     ));
   }
 
@@ -1641,8 +1641,8 @@ function mollom_validate_analysis(&$form, &$form_state) {
       case 'ham':
         $form_state['mollom']['require_captcha'] = FALSE;
         mollom_log(array(
-          'message' => 'Ham: %teaser',
-          'arguments' => array('%teaser' => $teaser),
+            'message' => 'Ham: %teaser',
+            'arguments' => array('%teaser' => $teaser),
         ), WATCHDOG_INFO);
         break;
 
@@ -1655,15 +1655,15 @@ function mollom_validate_analysis(&$form, &$form_state) {
           $form_state['mollom']['require_moderation'] = TRUE;
         }
         mollom_log(array(
-          'message' => 'Spam: %teaser',
-          'arguments' => array('%teaser' => $teaser),
+            'message' => 'Spam: %teaser',
+            'arguments' => array('%teaser' => $teaser),
         ));
         break;
 
       case 'unsure':
         mollom_log(array(
-          'message' => 'Unsure: %teaser',
-          'arguments' => array('%teaser' => $teaser),
+        'message' => 'Unsure: %teaser',
+        'arguments' => array('%teaser' => $teaser),
         ), WATCHDOG_INFO);
 
         // Only throw a validation error and retrieve a CAPTCHA, if we check
@@ -1684,8 +1684,8 @@ function mollom_validate_analysis(&$form, &$form_state) {
         // could be multiple reasons for this, it is not safe to trigger the
         // fallback mode.
         mollom_log(array(
-          'message' => 'Unknown: %teaser',
-          'arguments' => array('%teaser' => $teaser),
+        'message' => 'Unknown: %teaser',
+        'arguments' => array('%teaser' => $teaser),
         ));
         break;
     }
@@ -1707,7 +1707,7 @@ function mollom_validate_captcha(&$form, &$form_state) {
   // mollom_process_form(), or after performing text analysis. The second
   // return condition, $form_state['mollom']['passed_captcha'], may only ever be
   // set by this validation handler and must not be changed elsewhere.
- if (!$form_state['mollom']['require_captcha'] || $form_state['mollom']['passed_captcha']) {
+  if (!$form_state['mollom']['require_captcha'] || $form_state['mollom']['passed_captcha']) {
     $form['mollom']['captcha']['#access'] = FALSE;
     return;
   }
@@ -1735,9 +1735,9 @@ function mollom_validate_captcha(&$form, &$form_state) {
     return;
   }
   $data = array(
-    'id' => $form_state['mollom']['response']['captcha']['id'],
-    'solution' => $form_state['values']['mollom']['captcha'],
-    'authorIp' => $all_data['authorIp'],
+      'id' => $form_state['mollom']['response']['captcha']['id'],
+      'solution' => $form_state['values']['mollom']['captcha'],
+      'authorIp' => $all_data['authorIp'],
   );
   if (isset($all_data['authorId'])) {
     $data['authorId'] = $all_data['authorId'];
@@ -1763,7 +1763,7 @@ function mollom_validate_captcha(&$form, &$form_state) {
     $form['mollom']['captcha']['#access'] = FALSE;
 
     mollom_log(array(
-      'message' => 'Correct CAPTCHA',
+        'message' => 'Correct CAPTCHA',
     ), WATCHDOG_INFO);
   }
   else {
@@ -1771,7 +1771,7 @@ function mollom_validate_captcha(&$form, &$form_state) {
     mollom_form_add_captcha($form['mollom'], $form_state);
 
     mollom_log(array(
-      'message' => 'Incorrect CAPTCHA',
+        'message' => 'Incorrect CAPTCHA',
     ));
   }
 }
@@ -2087,14 +2087,14 @@ function _mollom_format_log(array $log) {
       if (isset($value)) {
         $message .= "@heading{$i}\n<pre>@value{$i}</pre>\n";
         $arguments += array(
-          '@heading' . $i => $token,
-          '@value' . $i => $value,
+            '@heading' . $i => $token,
+            '@value' . $i => $value,
         );
       }
       else {
         $message .= "<p>@heading{$i}</p>\n";
         $arguments += array(
-          '@heading' . $i => $token,
+            '@heading' . $i => $token,
         );
       }
       $i++;
@@ -2176,16 +2176,16 @@ function _mollom_send_feedback($data, $reason = 'spam') {
     return FALSE;
   }
   $params += array(
-    'reason' => $reason,
+      'reason' => $reason,
   );
   $result = mollom()->sendFeedback($params);
   mollom_log(array(
-    'message' => 'Reported %feedback for @resource %id.',
-    'arguments' => array(
-      '%feedback' => $reason,
-      '@resource' => $resource,
-      '%id' => $id,
-    ),
+      'message' => 'Reported %feedback for @resource %id.',
+      'arguments' => array(
+          '%feedback' => $reason,
+          '@resource' => $resource,
+          '%id' => $id,
+      ),
   ));
   return $result;
 }
@@ -2208,13 +2208,13 @@ function mollom_get_statistics($refresh = FALSE) {
   if ($refresh || !$cache || REQUEST_TIME >= $cache->expire) {
     if (_mollom_status() === TRUE) {
       $statistics = drupal_map_assoc(array(
-        'total_days',
-        'total_accepted',
-        'total_rejected',
-        'yesterday_accepted',
-        'yesterday_rejected',
-        'today_accepted',
-        'today_rejected',
+          'total_days',
+          'total_accepted',
+          'total_rejected',
+          'yesterday_accepted',
+          'yesterday_rejected',
+          'today_accepted',
+          'today_rejected',
       ));
 
       foreach ($statistics as $statistic) {
@@ -2264,9 +2264,9 @@ function mollom_field_extra_fields() {
       $bundle = (isset($info['bundle']) ? $info['bundle'] : $entity_type);
 
       $extras[$entity_type][$bundle]['form']['mollom'] = array(
-        'label' => t('Mollom'),
-        'description' => t('Mollom CAPTCHA or privacy policy link'),
-        'weight' => 99,
+          'label' => t('Mollom'),
+          'description' => t('Mollom CAPTCHA or privacy policy link'),
+          'weight' => 99,
       );
     }
   }
@@ -2286,8 +2286,8 @@ function mollom_get_captcha(&$form_state) {
   $key = 'captcha_url_' . $form_state['mollom']['captcha_type'];
   if (empty($form_state['mollom']['response'][$key])) {
     $data = array(
-      'type' => $form_state['mollom']['captcha_type'],
-      'ssl' => (int) (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'),
+        'type' => $form_state['mollom']['captcha_type'],
+        'ssl' => (int) (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'),
     );
     if (!empty($form_state['mollom']['response']['content']['id'])) {
       $data['contentId'] = $form_state['mollom']['response']['content']['id'];
@@ -2300,7 +2300,7 @@ function mollom_get_captcha(&$form_state) {
     // Add a log message to prevent the request log from appearing without a
     // message on CAPTCHA-only protected forms.
     mollom_log(array(
-      'message' => 'Retrieved new CAPTCHA',
+        'message' => 'Retrieved new CAPTCHA',
     ), WATCHDOG_DEBUG);
 
     if (is_array($result) && isset($result['url'])) {
@@ -2320,8 +2320,8 @@ function mollom_get_captcha(&$form_state) {
   switch ($form_state['mollom']['captcha_type']) {
     case 'audio':
       $source = url(base_path() . drupal_get_path('module', 'mollom') . '/mollom-captcha-player.swf', array(
-        'query' => array('url' => $url),
-        'external' => TRUE,
+      'query' => array('url' => $url),
+      'external' => TRUE,
       ));
       $output = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="110" height="50">';
       $output .= '<param name="allowFullScreen" value="false" />';
@@ -2393,8 +2393,8 @@ function mollom_mail_add_report_link(array &$message, array $mollom) {
     $data->form_id = $mollom['form_id'];
     mollom_data_save($data);
     $report_link = t('Report as inappropriate: @link', array(
-      '@link' => url("mollom/report/{$data->entity}/{$data->id}", array('absolute' => TRUE)),
-    ));
+        '@link' => url("mollom/report/{$data->entity}/{$data->id}", array('absolute' => TRUE)),
+        ));
     $message['body'][] = $report_link;
   }
 }
@@ -2560,7 +2560,7 @@ function mollom_moderate_validate_oauth() {
   $privateKey = variable_get('mollom_private_key', '');
   if ($publicKey === '' || $privateKey === '') {
     mollom_log(array(
-      'message' => 'Missing module configuration',
+        'message' => 'Missing module configuration',
     ), WATCHDOG_WARNING);
     return FALSE;
   }
@@ -2571,9 +2571,9 @@ function mollom_moderate_validate_oauth() {
   // Validate protocol parameters.
   if (!isset($header['oauth_consumer_key'], $header['oauth_nonce'], $header['oauth_timestamp'], $header['oauth_signature_method'], $header['oauth_signature'])) {
     mollom_log(array(
-      'message' => 'Missing protocol parameters',
-      'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
-      'Request headers:' => $header,
+        'message' => 'Missing protocol parameters',
+        'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
+        'Request headers:' => $header,
     ), WATCHDOG_WARNING);
     return FALSE;
   }
@@ -2586,10 +2586,10 @@ function mollom_moderate_validate_oauth() {
   // Validate consumer key.
   if ($header['oauth_consumer_key'] !== $publicKey) {
     mollom_log(array(
-      'message' => 'Invalid public/consumer key',
-      'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
-      'Request headers:' => $header,
-      'My public key:' => $publicKey,
+        'message' => 'Invalid public/consumer key',
+        'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
+        'Request headers:' => $header,
+        'My public key:' => $publicKey,
     ), WATCHDOG_WARNING);
     return FALSE;
   }
@@ -2602,10 +2602,10 @@ function mollom_moderate_validate_oauth() {
       $diff *= -1;
     }
     mollom_log(array(
-      'message' => 'Outdated authentication timestamp',
-      'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
-      'Request headers:' => $header,
-      'Time difference:' => $diff_sign . format_interval($diff),
+        'message' => 'Outdated authentication timestamp',
+        'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
+        'Request headers:' => $header,
+        'Time difference:' => $diff_sign . format_interval($diff),
     ), WATCHDOG_WARNING);
     return FALSE;
   }
@@ -2613,9 +2613,9 @@ function mollom_moderate_validate_oauth() {
   // Validate nonce.
   if (empty($header['oauth_nonce'])) {
     mollom_log(array(
-      'message' => 'Missing authentication nonce',
-      'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
-      'Request headers:' => $header,
+        'message' => 'Missing authentication nonce',
+        'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
+        'Request headers:' => $header,
     ), WATCHDOG_WARNING);
     return FALSE;
   }
@@ -2627,9 +2627,9 @@ function mollom_moderate_validate_oauth() {
   }
   if (isset($nonces[$header['oauth_nonce']])) {
     mollom_log(array(
-      'message' => 'Replay attack',
-      'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
-      'Request headers:' => $header,
+        'message' => 'Replay attack',
+        'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
+        'Request headers:' => $header,
     ), WATCHDOG_WARNING);
     return FALSE;
   }
@@ -2643,9 +2643,9 @@ function mollom_moderate_validate_oauth() {
 
   // Validate signature.
   $base_string = implode('&', array(
-    $_SERVER['REQUEST_METHOD'],
-    Mollom::rawurlencode($GLOBALS['base_url'] . '/' . $_GET['q']),
-    Mollom::rawurlencode(Mollom::httpBuildQuery($data + $header)),
+      $_SERVER['REQUEST_METHOD'],
+      Mollom::rawurlencode($GLOBALS['base_url'] . '/' . $_GET['q']),
+      Mollom::rawurlencode(Mollom::httpBuildQuery($data + $header)),
   ));
   $key = Mollom::rawurlencode($privateKey) . '&' . '';
   $signature = rawurlencode(base64_encode(hash_hmac('sha1', $base_string, $key, TRUE)));
@@ -2653,12 +2653,12 @@ function mollom_moderate_validate_oauth() {
   $valid = ($signature === $sent_signature);
   if (!$valid) {
     mollom_log(array(
-      'message' => 'Invalid authentication signature',
-      'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
-      'Request headers:' => $header + array('oauth_signature' => $sent_signature),
-      'Base string:' => $base_string,
-      'Expected signature:' => $signature,
-      //'Expected key:' => $key,
+        'message' => 'Invalid authentication signature',
+        'Request:' => $_SERVER['REQUEST_METHOD'] . ' ' . $_GET['q'],
+        'Request headers:' => $header + array('oauth_signature' => $sent_signature),
+        'Base string:' => $base_string,
+        'Expected signature:' => $signature,
+        //'Expected key:' => $key,
     ), WATCHDOG_WARNING);
   }
   return $valid;
@@ -2725,9 +2725,9 @@ function mollom_moderate($data, $action) {
       $messages[] = "Attempt to delete $form_info[entity] entity via {$form_info['delete form']} form.";
       if (isset($form_info['delete form file'])) {
         $file = $form_info['delete form file'] + array(
-          'type' => 'inc',
-          'module' => $form_info['module'],
-          'name' => NULL,
+            'type' => 'inc',
+            'module' => $form_info['module'],
+            'name' => NULL,
         );
         module_load_include($file['type'], $file['module'], $file['name']);
         $messages[] = "Loaded {$file['name']}.{$file['type']} in {$file['module']}.";
@@ -2769,12 +2769,12 @@ function mollom_moderate($data, $action) {
 
   if ($result) {
     mollom_log(array(
-      'message' => '%action moderation success for @entity @id',
-      'arguments' => array(
-        '%action' => $action,
-        '@entity' => $data->entity,
-        '@id' => $data->id,
-      ),
+        'message' => '%action moderation success for @entity @id',
+        'arguments' => array(
+            '%action' => $action,
+            '@entity' => $data->entity,
+            '@id' => $data->id,
+        ),
     ));
   }
   else {
@@ -2782,17 +2782,17 @@ function mollom_moderate($data, $action) {
     drupal_add_http_header('Status', '400 Unable to process moderation request');
 
     mollom_log(array(
-      'message' => '%action moderation failure for @entity @id',
-      'arguments' => array(
-        '%action' => $action,
-        '@entity' => $data->entity,
-        '@id' => $data->id,
-      ),
-      'Form ID:' => $data->form_id,
-      'Actions:' => $messages,
-      'Mollom data:' => (array) $data,
-      'Mollom form:' => $form_info,
-      'System messages:' => drupal_get_messages(),
+        'message' => '%action moderation failure for @entity @id',
+        'arguments' => array(
+            '%action' => $action,
+            '@entity' => $data->entity,
+            '@id' => $data->id,
+        ),
+        'Form ID:' => $data->form_id,
+        'Actions:' => $messages,
+        'Mollom data:' => (array) $data,
+        'Mollom form:' => $form_info,
+        'System messages:' => drupal_get_messages(),
     ), WATCHDOG_ERROR);
   }
 
@@ -2817,15 +2817,15 @@ function node_mollom_form_list() {
   foreach (node_type_get_types() as $type) {
     $form_id = $type->type . '_node_form';
     $forms[$form_id] = array(
-      'title' => t('@name form', array('@name' => $type->name)),
-      'entity' => 'node',
-      'bundle' => $type->type,
-      'delete form' => 'node_delete_confirm',
-      'delete form file' => array(
-        'name' => 'node.pages',
-      ),
-      'entity delete multiple callback' => 'node_delete_multiple',
-      'report access' => array('bypass node access', 'administer nodes'),
+        'title' => t('@name form', array('@name' => $type->name)),
+        'entity' => 'node',
+        'bundle' => $type->type,
+        'delete form' => 'node_delete_confirm',
+        'delete form file' => array(
+            'name' => 'node.pages',
+        ),
+        'entity delete multiple callback' => 'node_delete_multiple',
+        'report access' => array('bypass node access', 'administer nodes'),
     );
   }
   return $forms;
@@ -2840,15 +2840,14 @@ function node_mollom_form_info($form_id) {
 
   $type = node_type_get_type($nodetype);
   $form_info = array(
-    // @todo This is incompatible with node access.
-    'bypass access' => array('bypass node access'),
-    'bundle' => $type->type,
-    'moderation callback' => 'node_mollom_form_moderation',
-    'elements' => array(),
-    'mapping' => array(
-      'post_id' => 'nid',
-      'author_name' => 'name',
-    ),
+      // @todo This is incompatible with node access.
+      'bypass access' => array('bypass node access'),
+      'bundle' => $type->type,
+      'moderation callback' => 'node_mollom_form_moderation',
+      'elements' => array(),
+      'mapping' => array(
+          'author_name' => 'name',
+      ),
   );
   // @see node_permission()
   if (in_array($type->type, node_permissions_get_configured_types())) {
@@ -2860,18 +2859,26 @@ function node_mollom_form_info($form_id) {
     $form_info['elements']['title'] = check_plain($type->title_label);
     $form_info['mapping']['post_title'] = 'title';
   }
-
-  // Add text fields.
-  $fields = field_info_fields();
-  foreach (field_info_instances('node', $type->type) as $field_name => $field) {
-    if (in_array($fields[$field_name]['type'], array('text', 'text_long', 'text_with_summary'))) {
-      $form_info['elements'][$field_name . '][' . LANGUAGE_NONE . '][0][value'] = check_plain(t($field['label']));
+  mollom_add_entity_form_info($form_info, 'node', $type->type);
+  
+  return $form_info;
+}
+/**
+ * Add Common Entity info including fields
+ */
+function mollom_add_entity_form_info(&$form_info, $entity_type, $bundle) {
+  $entity_info = entity_get_info($entity_type);
+  $form_info['mapping']['post_id'] = $entity_info['entity keys']['id'];
+  if ($entity_info['fieldable']) {
+    // Add text fields.
+    $fields = field_info_fields();
+    foreach (field_info_instances($entity_type, $bundle) as $field_name => $field) {
+      if (in_array($fields[$field_name]['type'], array('text', 'text_long', 'text_with_summary'))) {
+        $form_info['elements'][$field_name . '][' . LANGUAGE_NONE . '][0][value'] = check_plain(t($field['label']));
+      }
     }
   }
-
-  return $form_info;
 }
-
 /**
  * Mollom form moderation callback for nodes.
  */
@@ -2918,15 +2925,15 @@ function comment_mollom_form_list() {
   foreach (node_type_get_types() as $type) {
     $form_id = "comment_node_{$type->type}_form";
     $forms[$form_id] = array(
-      'title' => t('@name comment form', array('@name' => $type->name)),
-      'entity' => 'comment',
-      'bundle' => 'comment_node_' . $type->type,
-      'delete form' => 'comment_confirm_delete',
-      'delete form file' => array(
-        'name' => 'comment.admin',
-      ),
-      'report access' => array('administer comments'),
-      'entity delete multiple callback' => 'comment_delete_multiple',
+        'title' => t('@name comment form', array('@name' => $type->name)),
+        'entity' => 'comment',
+        'bundle' => 'comment_node_' . $type->type,
+        'delete form' => 'comment_confirm_delete',
+        'delete form file' => array(
+            'name' => 'comment.admin',
+        ),
+        'report access' => array('administer comments'),
+        'entity delete multiple callback' => 'comment_delete_multiple',
     );
   }
   return $forms;
@@ -2936,24 +2943,23 @@ function comment_mollom_form_list() {
  * Implements hook_mollom_form_info().
  */
 function comment_mollom_form_info($form_id) {
+  // Retrieve internal type from $form_id.
+  $comment_bundle = drupal_substr($form_id, 0, -5);
   $form_info = array(
-    'mode' => MOLLOM_MODE_ANALYSIS,
-    'bypass access' => array('administer comments'),
-    'moderation callback' => 'comment_mollom_form_moderation',
-    'elements' => array(
-      'subject' => t('Subject'),
-      // @todo Update for Field API.
-      'comment_body][und][0][value' => t('Comment'),
-    ),
-    'mapping' => array(
-      'post_id' => 'cid',
-      'post_title' => 'subject',
-      'author_name' => 'name',
-      'author_mail' => 'mail',
-      'author_url' => 'homepage',
-    ),
+      'mode' => MOLLOM_MODE_ANALYSIS,
+      'bypass access' => array('administer comments'),
+      'moderation callback' => 'comment_mollom_form_moderation',
+      'elements' => array(
+          'subject' => t('Subject'),
+      ),
+      'mapping' => array(
+          'post_title' => 'subject',
+          'author_name' => 'name',
+          'author_mail' => 'mail',
+          'author_url' => 'homepage',
+      ),
   );
-
+  mollom_add_entity_form_info($form_info, 'comment', $comment_bundle);
   return $form_info;
 }
 
@@ -3000,14 +3006,14 @@ function mollom_form_comment_multiple_delete_confirm_submit($form, &$form_state)
  */
 function user_mollom_form_list() {
   $forms['user_register_form'] = array(
-    'title' => t('User registration form'),
-    'entity' => 'user',
-    'delete form' => 'user_cancel_confirm_form',
-    'report access' => array('administer users'),
-    'entity delete multiple callback' => 'user_delete_multiple',
+      'title' => t('User registration form'),
+      'entity' => 'user',
+      'delete form' => 'user_cancel_confirm_form',
+      'report access' => array('administer users'),
+      'entity delete multiple callback' => 'user_delete_multiple',
   );
   $forms['user_pass'] = array(
-    'title' => t('User password request form'),
+      'title' => t('User password request form'),
   );
   return $forms;
 }
@@ -3019,27 +3025,27 @@ function user_mollom_form_info($form_id) {
   switch ($form_id) {
     case 'user_register_form':
       $form_info = array(
-        'bypass access' => array('administer users'),
-        'moderation callback' => 'user_mollom_form_moderation',
-        'mail ids' => array('user_register_pending_approval_admin'),
-        'mapping' => array(
-          'post_id' => 'uid',
-          'author_name' => 'name',
-          'author_mail' => 'mail',
-        ),
+      'bypass access' => array('administer users'),
+      'moderation callback' => 'user_mollom_form_moderation',
+      'mail ids' => array('user_register_pending_approval_admin'),
+      'mapping' => array(
+      'post_id' => 'uid',
+      'author_name' => 'name',
+      'author_mail' => 'mail',
+      ),
       );
       return $form_info;
 
     case 'user_pass':
       $form_info = array(
-        'mode' => MOLLOM_MODE_CAPTCHA,
-        'bypass access' => array('administer users'),
-        'mapping' => array(
-          'post_id' => 'uid',
-          'author_name' => 'name',
-          // The 'name' form element accepts either a username or mail address.
-          'author_mail' => 'name',
-        ),
+      'mode' => MOLLOM_MODE_CAPTCHA,
+      'bypass access' => array('administer users'),
+      'mapping' => array(
+      'post_id' => 'uid',
+      'author_name' => 'name',
+      // The 'name' form element accepts either a username or mail address.
+      'author_mail' => 'name',
+      ),
       );
       return $form_info;
   }
@@ -3088,10 +3094,10 @@ function mollom_form_user_multiple_cancel_confirm_submit($form, &$form_state) {
  */
 function contact_mollom_form_list() {
   $forms['contact_site_form'] = array(
-    'title' => t('Site-wide contact form'),
+      'title' => t('Site-wide contact form'),
   );
   $forms['contact_personal_form'] = array(
-    'title' => t('User contact form'),
+      'title' => t('User contact form'),
   );
   return $forms;
 }
@@ -3103,35 +3109,35 @@ function contact_mollom_form_info($form_id) {
   switch ($form_id) {
     case 'contact_site_form':
       $form_info = array(
-        'mode' => MOLLOM_MODE_ANALYSIS,
-        'bypass access' => array('administer contact forms'),
-        'mail ids' => array('contact_page_mail'),
-        'elements' => array(
-          'subject' => t('Subject'),
-          'message' => t('Message'),
-        ),
-        'mapping' => array(
-          'post_title' => 'subject',
-          'author_name' => 'name',
-          'author_mail' => 'mail',
-        ),
+      'mode' => MOLLOM_MODE_ANALYSIS,
+      'bypass access' => array('administer contact forms'),
+      'mail ids' => array('contact_page_mail'),
+      'elements' => array(
+      'subject' => t('Subject'),
+      'message' => t('Message'),
+      ),
+      'mapping' => array(
+      'post_title' => 'subject',
+      'author_name' => 'name',
+      'author_mail' => 'mail',
+      ),
       );
       return $form_info;
 
     case 'contact_personal_form':
       $form_info = array(
-        'mode' => MOLLOM_MODE_ANALYSIS,
-        'bypass access' => array('administer users'),
-        'mail ids' => array('contact_user_mail'),
-        'elements' => array(
-          'subject' => t('Subject'),
-          'message' => t('Message'),
-        ),
-        'mapping' => array(
-          'post_title' => 'subject',
-          'author_name' => 'name',
-          'author_mail' => 'mail',
-        ),
+      'mode' => MOLLOM_MODE_ANALYSIS,
+      'bypass access' => array('administer users'),
+      'mail ids' => array('contact_user_mail'),
+      'elements' => array(
+      'subject' => t('Subject'),
+      'message' => t('Message'),
+      ),
+      'mapping' => array(
+      'post_title' => 'subject',
+      'author_name' => 'name',
+      'author_mail' => 'mail',
+      ),
       );
       return $form_info;
   }
@@ -3157,7 +3163,7 @@ function profile_mollom_form_info_alter(&$form_info, $form_id) {
   }
   // @see profile_form_profile()
   $result = db_query("SELECT name, title FROM {profile_field} WHERE register = 1 AND type IN (:types)", array(
-    ':types' => array('textfield', 'textarea', 'url', 'list'),
+      ':types' => array('textfield', 'textarea', 'url', 'list'),
   ));
   foreach ($result as $field) {
     $form_info['elements'][$field->name] = check_plain($field->title);
