diff --git a/webform-results-submissions.tpl.php b/webform-results-submissions.tpl.php
index a2441b2..15441c5 100644
--- a/webform-results-submissions.tpl.php
+++ b/webform-results-submissions.tpl.php
@@ -1,5 +1,5 @@
 <?php
-// $Id:
+// $Id$
 
 /**
  * @file
@@ -44,4 +44,4 @@ drupal_add_css(drupal_get_path('module', 'webform') . '/css/webform-admin.css',
 
 <?php if ($pager_count): ?>
   <?php print theme('pager', NULL, $pager_count, 0); ?>
-<?php endif; ?>
+<?php endif;
diff --git a/webform_civicrm.install b/webform_civicrm.install
index 779d769..e378f4c 100644
--- a/webform_civicrm.install
+++ b/webform_civicrm.install
@@ -142,7 +142,7 @@ function webform_civicrm_update_6101() {
     $params[$n] = array($row['activity_id'], 'Integer');
     $params[$n+1] = array($row['contact_id'], 'Integer');
     if ($n > 1) {
-      $sql .= ',(%'.$n.',%'.($n+1).')';
+      $sql .= ',(%' . $n . ',%' . ($n+1) . ')';
     }
     $n += 2;
     ++$c;
diff --git a/webform_civicrm_forms.inc b/webform_civicrm_forms.inc
index 7100caf..04da846 100644
--- a/webform_civicrm_forms.inc
+++ b/webform_civicrm_forms.inc
@@ -12,14 +12,14 @@ require_once 'webform_civicrm_utils.inc';
  * Form to configure CiviCRM options for a Webform
  */
 function webform_civicrm_configure_form(&$form_state, $node) {
-  drupal_add_js(drupal_get_path('module', 'webform_civicrm') .'/webform_civicrm_forms.js', 'module', 'header');
-  drupal_add_css(drupal_get_path('module', 'webform_civicrm') .'/webform_civicrm_style.css');
+  drupal_add_js(drupal_get_path('module', 'webform_civicrm') . '/webform_civicrm_forms.js', 'module', 'header');
+  drupal_add_css(drupal_get_path('module', 'webform_civicrm') . '/webform_civicrm_style.css');
   civicrm_initialize();
 
   $fields = webform_civicrm_get_fields();
   $settings = $node->webform_civicrm;
   $enabled = webform_civicrm_enabled_fields($node);
-  $tokens = '<strong>'. t('Tokens Available:') .'</strong> ['. implode('], [', webform_civicrm_get_fields('tokens')) .'].';
+  $tokens = '<strong>' . t('Tokens Available:') . '</strong> [' . implode('], [', webform_civicrm_get_fields('tokens')) . '].';
   $acts = webform_civicrm_get_options('activity_type', 'arr', t('- no activity -'));
   $readme_link = array('!link' => 'href="/admin/help/webform_civicrm" target="_blank" class="popup-webform-civicrm-help"');
   $form = array('#prefix' => t('Use the options below to configure CiviCRM processing for this form.'));
@@ -34,12 +34,12 @@ function webform_civicrm_configure_form(&$form_state, $node) {
       '#title' => t('Enable CiviCRM Processing'),
       '#default_value' => (bool)$settings,
       '#return_value' => $node->nid,
-      '#description' => '<ul><li>'.
-      t('CiviCRM contacts will be created or updated when users submit this webform.') .'</li><li>'.
-      t('Logged-in users will have their contact info already filled-in for them.') .'</li><li>'.
-      t('The form will also be auto-filled for anonymous users if you send them this link using CiviMail:') .'<br />'. 
-      url('node/'. $node->nid, array('query' => 'cid={contact.contact_id}&{contact.checksum}')) .'</li><li>'.
-      t('<a !link>Read the instructions</a> for more info.', $readme_link) .'</li></ul>'
+      '#description' => '<ul><li>' .
+      t('CiviCRM contacts will be created or updated when users submit this webform.') . '</li><li>' .
+      t('Logged-in users will have their contact info already filled-in for them.') . '</li><li>' .
+      t('The form will also be auto-filled for anonymous users if you send them this link using CiviMail:') . '<br />' .
+      url('node/' . $node->nid, array('query' => 'cid={contact.contact_id}&{contact.checksum}')) . '</li><li>' .
+      t('<a !link>Read the instructions</a> for more info.', $readme_link) . '</li></ul>'
   );
   $form['prefix'] = array(
     '#type'  => 'fieldset',
@@ -74,7 +74,7 @@ function webform_civicrm_configure_form(&$form_state, $node) {
     '#default_value' => $settings['message'],
     '#size' => 100,
     '#maxlength' => 255,
-    '#description' => t('Enclose your "not you" link text in curly brackets {like this}.') .'<p>'. $tokens .'</p>'
+    '#description' => t('Enclose your "not you" link text in curly brackets {like this}.') . '<p>' . $tokens . '</p>'
   );
   if (!$settings['message']) {
     $form['st_message']['message']['#default_value'] = t("You are viewing this form as [display name]. Please {click here if that's not you}.");
@@ -100,27 +100,28 @@ function webform_civicrm_configure_form(&$form_state, $node) {
   $form['fields'] = array(
     '#type'  => 'fieldset',
     '#title' => t('Enable Fields'),
-    '#description' => '<p class="web-civi-p">'. t('Webform components will be created for you automatically when you check these boxes. You may then configure, arrange, or delete them using the standard Webform interface.'). '</p>',
+    '#description' => '<p class="web-civi-p">' . t('Webform components will be created for you automatically when you check these boxes. You may then configure, arrange, or delete them using the standard Webform interface.') . '</p>',
     '#attributes' => array('class' => 'web-civi-container')
   );
-    $form['fields']['box'] = array(
-      '#prefix' => '<div class="scrollme">',
-      '#suffix' => '</div>',
-    );
-      // Three columns for neatness
-      $form['fields']['box']['contact'] = array(
-        '#prefix' => '<div class="web-civi-3-col"><h4>'. t('Contact Fields') .'</h4><div class="web-civi-description">'. t('First name, Last name, and Email fields are all <em>required</em> by CiviCRM in order to create new contacts.') .'</div>',
-        '#suffix' => '</div>'
-      );
-      $form['fields']['box']['groups'] = array(
-        '#prefix' => '<div class="web-civi-3-col"><h4>'. t('Groups and Tags') .'</h4><div class="web-civi-description">'. t('These fields will add contacts who submit this form to groups and tags of your choosing. Configuration is done by editing the webform component.') .'</div>',
-        '#suffix' => '</div>'
-      );
-      $form['fields']['box']['custom'] = array(
-        '#prefix' => '<div class="web-civi-3-col"><h4>'. t('Custom Fields') .'</h4><div class="web-civi-description">'. t('Correct handling of custom fields requires proper permission configuration.') .' '.
-    t('<a !link>Read the instructions</a> for more info.', $readme_link) .'</div>',
-        '#suffix' => '</div>'
-      );
+
+  $form['fields']['box'] = array(
+    '#prefix' => '<div class="scrollme">',
+    '#suffix' => '</div>',
+  );
+  // Three columns for neatness
+  $form['fields']['box']['contact'] = array(
+    '#prefix' => '<div class="web-civi-3-col"><h4>' . t('Contact Fields') . '</h4><div class="web-civi-description">' . t('First name, Last name, and Email fields are all <em>required</em> by CiviCRM in order to create new contacts.') . '</div>',
+    '#suffix' => '</div>'
+  );
+  $form['fields']['box']['groups'] = array(
+    '#prefix' => '<div class="web-civi-3-col"><h4>' . t('Groups and Tags') . '</h4><div class="web-civi-description">' . t('These fields will add contacts who submit this form to groups and tags of your choosing. Configuration is done by editing the webform component.') . '</div>',
+    '#suffix' => '</div>'
+  );
+  $form['fields']['box']['custom'] = array(
+    '#prefix' => '<div class="web-civi-3-col"><h4>' . t('Custom Fields') . '</h4><div class="web-civi-description">' . t('Correct handling of custom fields requires proper permission configuration.') . ' ' .
+    t('<a !link>Read the instructions</a> for more info.', $readme_link) . '</div>',
+    '#suffix' => '</div>'
+  );
   // CiviCRM fields are enabled through these checkboxes
   $c = 'contact';
   $sets = array('civicrm_first_name' => 'Contact', 'civicrm_street_address' => 'Address', 'civicrm_phone' => 'Phone', 'civicrm_groups' => 'Groups', 'civicrm_tags' => 'Tags');
@@ -165,7 +166,7 @@ function webform_civicrm_configure_form(&$form_state, $node) {
     $form['fields']['box'][$c][$set][$id] = $f;
   }
   if ($c != 'custom') {
-    $form['fields']['box']['custom']['#prefix'] .= '<p>'. t('You have no custom fields enabled in CiviCRM.') .'</p>';
+    $form['fields']['box']['custom']['#prefix'] .= '<p>' . t('You have no custom fields enabled in CiviCRM.') . '</p>';
   }
 
   $form['options'] = array(
@@ -178,7 +179,7 @@ function webform_civicrm_configure_form(&$form_state, $node) {
       '#type' => 'checkbox',
       '#title' => t('Confirm Subscriptions'),
       '#default_value' => (bool)$settings['confirm_subscription'],
-      '#description' => t('Recommended. Send a confirmation email before adding contacts to publicly subscribable mailing list groups.') .'<br />'. t('Your public mailing lists:') .' <em>'. implode(', ',webform_civicrm_get_options('mailing_lists','arr')) .'</em>'
+      '#description' => t('Recommended. Send a confirmation email before adding contacts to publicly subscribable mailing list groups.') . '<br />' . t('Your public mailing lists:') . ' <em>' . implode(', ', webform_civicrm_get_options('mailing_lists', 'arr')) . '</em>'
     );
     $form['options']['block_unknown_users'] = array(
       '#prefix' => '<div class="web-civi-3-col">',
@@ -211,7 +212,7 @@ function webform_civicrm_configure_form_submit($form, &$form_state) {
   $node = node_load($nid=arg(1));
   $fields = webform_civicrm_get_fields();
   $enabled = webform_civicrm_enabled_fields($node);
-  $form_state['redirect'] = 'node/'. $nid .'/webform';
+  $form_state['redirect'] = 'node/' . $nid . '/webform';
 
   // Disable CiviCRM for this form
   if ($node->webform_civicrm && !$vals['nid']) {
@@ -220,8 +221,9 @@ function webform_civicrm_configure_form_submit($form, &$form_state) {
   }
   // CiviCRM enabled
   else{
-    if (!$vals['toggle_message'])
+    if (!$vals['toggle_message']) {
       $vals['message'] = '';
+    }
     // Write/update record
     if (!$node->webform_civicrm) {
       drupal_write_record('webform_civicrm_forms', $vals);
@@ -243,8 +245,9 @@ function webform_civicrm_configure_form_submit($form, &$form_state) {
         $field['pid'] = 0;
         unset($field['custom_group']);
 
-        if (($field['type'] == 'textfield' || $field['type'] == 'email') && !$field['extra']['width'])
+        if (($field['type'] == 'textfield' || $field['type'] == 'email') && !$field['extra']['width']) {
           $field['extra']['width'] = 20;
+        }
 
         // Set default country
         if ($id == 'civicrm_country_id') {
@@ -254,18 +257,20 @@ function webform_civicrm_configure_form_submit($form, &$form_state) {
         // Retrieve option list
         if (array_key_exists($id, $lists)) {
           $field['extra']['items'] = webform_civicrm_get_options($lists[$id]);
-          if (!isset($field['extra']['aslist']))
+          if (!isset($field['extra']['aslist'])) {
             $field['extra']['aslist'] = 1;
+          }
         }
         // Create webform component
         $fid = webform_component_insert($field);
 
         if ($id == 'civicrm_groups') {
           drupal_set_message(t('Please choose which group(s) you want to be selectable by users of this form.'));
-          $form_state['redirect'] = 'node/'. $nid .'/webform/components/'. $fid;
+          $form_state['redirect'] = 'node/' . $nid . '/webform/components/' . $fid;
         }
-        else
+        else {
           $new_fields = TRUE;
+        }
       }
       ++$i;
     }
@@ -288,16 +293,19 @@ function webform_civicrm_process_group_selection($form, &$form_state) {
       if ($gid) {
         if ($items)
           $items .= "\n";
-        $items .= $gid .'|'. $groups[$gid];
+        $items .= $gid . '|' . $groups[$gid];
       }
     }
     $form_state['values']['extra']['items'] = $items;
   }
   $form_state['values']['value'] = '';
   foreach ($form_state['values']['civicrm_groups_fieldset']['civicrm_group_defaults'] as $gid) {
-    if (!$gid) continue;
-    if ($form_state['values']['value'])
+    if (!$gid) {
+      continue;
+    }
+    if ($form_state['values']['value']) {
       $form_state['values']['value'] .= ',';
+    }
     $form_state['values']['value'] .= $gid;
   }
 }
@@ -308,13 +316,14 @@ function webform_civicrm_process_group_selection($form, &$form_state) {
  * Called by _webform_civicrm_webform_frontend_form_alter() when webform is being viewed by a known contact
  * @Param $elements: FAPI array
  * @Param $contact: Array of CiviCRM contact data
- * Matching is done through 
+ * Matching is done through
  */
 function webform_civicrm_fill_values(&$elements, $contact) {
   $sp = CRM_Core_DAO::VALUE_SEPARATOR;
   foreach ($elements as $eid => &$element) {
-    if (substr($eid, 0, 1) == '#' || !is_array($element))
+    if (substr($eid, 0, 1) == '#' || !is_array($element)) {
       continue;
+    }
     if ($element['#type'] == 'fieldset') {
       // Recurse through fieldsets
       webform_civicrm_fill_values($element, $contact);
@@ -353,7 +362,7 @@ function webform_civicrm_process_submission($node, $submission) {
       'subject' => $node->webform_civicrm['activity_subject'],
       'status_id' => 2,
       'activity_date_time' => date('Ymdhis'),
-      'details' => l(t('View Webform Submission'), 'node/'. $node->nid .'/submission/'. $submission->sid)
+      'details' => l(t('View Webform Submission'), 'node/' . $node->nid . '/submission/' . $submission->sid)
     );
     $result = civicrm_activity_create($act_params);
     $act = $result['id'];
@@ -375,7 +384,7 @@ function _webform_civicrm_webform_component_form_alter(&$form) {
     $key = $form['form_key']['#default_value'];
     // Is this component a CiviCRM field?
     if (array_key_exists($key, $fields)) {
-      drupal_add_css(drupal_get_path('module', 'webform_civicrm') .'/webform_civicrm_style.css');
+      drupal_add_css(drupal_get_path('module', 'webform_civicrm') . '/webform_civicrm_style.css');
 
       // Prevent users from editing the form_key and breaking things
       $form['form_key']['#disabled'] = TRUE;
@@ -389,24 +398,26 @@ function _webform_civicrm_webform_component_form_alter(&$form) {
         $complete_msg = t('The options have been reloaded.');
         $form['extra']['items']['#description'] = t("These options were automatically selected from the CiviCRM database. You may change their order, or delete unwanted options as you see fit. You may also change the labels (text after the |) to be more descriptive. However, adding new items here that are <em>not</em> in CiviCRM won't work. Instead, create your new options in CiviCRM, then click here to refresh this list:");
         if ($_GET['reload-data']) {
-          $form['extra']['items']['#description'] .= '<div style="color:green; font-weight:bold; margin-top:0.5em;">'. $complete_msg .'</div>';
+          $form['extra']['items']['#description'] .= '<div style="color:green; font-weight:bold; margin-top:0.5em;">' . $complete_msg . '</div>';
           $form['extra']['items']['#default_value'] = webform_civicrm_get_options($key);
 
         }
-        else $form['extra']['items']['#description'] .= '<div id="civicrm-ajax" style="color:green; font-weight:bold; margin-top:0.5em;">'. l(t('Reload options'), $_GET['q'], array('query' => 'reload-data=1', 'attributes' => array('style' => 'color:blue;',
-        'onclick' => "$(this).addClass('views-throbbing');
-          $.ajax({
-            url: '/webform-civicrm/js/". arg(1) ."/$key',
-            success: function(data) {
-              $('#edit-extra-items').val(data);
-              $('#civicrm-ajax').html('$complete_msg');
-            }
-          }); return false;"))) .'</div>';
+        else {
+          $form['extra']['items']['#description'] .= '<div id="civicrm-ajax" style="color:green; font-weight:bold; margin-top:0.5em;">' . l(t('Reload options'), $_GET['q'], array('query' => 'reload-data=1', 'attributes' => array('style' => 'color:blue;',
+            'onclick' => "$(this).addClass('views-throbbing');
+            $.ajax({
+              url: '/webform-civicrm/js/" . arg(1) . "/$key',
+              success: function(data) {
+                $('#edit-extra-items').val(data);
+                $('#civicrm-ajax').html('$complete_msg');
+              }
+            }); return false;"))) . '</div>';
+        }
       }
       elseif ($key == 'civicrm_contact_id') {
         $form['value']['#type'] = 'hidden';
         $form['value']['#value'] = 0;
-        $form['#prefix'] = '<p>' .t('There are no configuration options for this hidden field. You can use it for post processing, for example to include a link to the CiviCRM contact in an email.') .'</p>';
+        $form['#prefix'] = '<p>' . t('There are no configuration options for this hidden field. You can use it for post processing, for example to include a link to the CiviCRM contact in an email.') . '</p>';
       }
 
       // Special options for CiviCRM groups
@@ -462,10 +473,10 @@ function _webform_civicrm_webform_component_form_alter(&$form) {
       // Autocomplete widget for selecting tags
       elseif ($key == 'civicrm_tags') {
         $form['value']['#title'] = t('Tags');
-        $form['value']['#description'] = t('Enter a comma-separated list of tags to add to contacts who submit this webform.') .'<br />'. t('Use the autocomplete to select existing tags, or you may add new ones.');
+        $form['value']['#description'] = t('Enter a comma-separated list of tags to add to contacts who submit this webform.') . '<br />' . t('Use the autocomplete to select existing tags, or you may add new ones.');
         $form['value']['#type'] = 'textfield';
         $form['value']['#size'] = 100;
-        $form['value']['#autocomplete_path'] = 'webform-civicrm/js/'.$form['nid']['#value'].'/tags';
+        $form['value']['#autocomplete_path'] = 'webform-civicrm/js/' . $form['nid']['#value'] . '/tags';
       }
       // Auto set multi-value option for other fields based on schema
       elseif ($form['extra']['multiple']) {
diff --git a/webform_civicrm_forms.js b/webform_civicrm_forms.js
index f1e003e..259cfec 100644
--- a/webform_civicrm_forms.js
+++ b/webform_civicrm_forms.js
@@ -1,3 +1,5 @@
+// $Id$
+
 if (Drupal.jsEnabled) {
   $(document).ready( function(){
 
diff --git a/webform_civicrm_style.css b/webform_civicrm_style.css
index d002d44..6838152 100644
--- a/webform_civicrm_style.css
+++ b/webform_civicrm_style.css
@@ -1,3 +1,5 @@
+// $Id$
+
 .web-civi-3-col {
   float:left;
   width:32%;
diff --git a/webform_civicrm_utils.inc b/webform_civicrm_utils.inc
index fa4317b..a78dcb5 100644
--- a/webform_civicrm_utils.inc
+++ b/webform_civicrm_utils.inc
@@ -98,8 +98,10 @@ function webform_civicrm_contact_match($node, &$submission) {
     $params['civicrm_contact']['check_permission'] = FALSE;
     civicrm_contact_update($params['civicrm_contact']);
   }
-  else  // If an error occurred and we couldn't create contact, stop here.
+  else  {
+    // If an error occurred and we couldn't create contact, stop here.
     return;
+  }
 
   if ($enabled['civicrm_contact_id']) {
     $submission->data[$enabled['civicrm_contact_id']]['value'] = array($cid);
@@ -167,7 +169,7 @@ function webform_civicrm_contact_match($node, &$submission) {
         $param = array('contact_id' => $cid, 'return_email' => 1);
         $info = civicrm_contact_get($params);
         $mailer_params = array('contact_id' => $cid, 'email' => $info[$cid]['email']);
-        $mailing_lists = webform_civicrm_get_options('mailing_lists','arr');
+        $mailing_lists = webform_civicrm_get_options('mailing_lists', 'arr');
       }
       else {
         $mailing_lists = array();
@@ -187,7 +189,7 @@ function webform_civicrm_contact_match($node, &$submission) {
         }
       }
       if (!empty($confirmations_sent)) {
-        drupal_set_message(t('A confirmation has been sent to your email address, please follow the instructions in that message to finalize your subscription to @groups.', array('@groups' => implode(' '. t('and') .' ', $confirmations_sent))));
+        drupal_set_message(t('A confirmation has been sent to your email address, please follow the instructions in that message to finalize your subscription to @groups.', array('@groups' => implode(' ' . t('and') . ' ', $confirmations_sent))));
       }
     }
     // Remove contact from groups if they have unchecked them on the form
@@ -202,7 +204,7 @@ function webform_civicrm_contact_match($node, &$submission) {
       foreach ($remove_groups as $group_params['group_id'] => $group) {
         if (in_array($group_params['group_id'], $in_groups)) {
           civicrm_group_contact_remove($group_params);
-          drupal_set_message(t('You have removed yourself from') .' '. $group .'.');
+          drupal_set_message(t('You have removed yourself from') . ' ' . $group . '.');
         }
       }
     }
@@ -247,7 +249,7 @@ function webform_civicrm_get_options($option_group, $var='str', $null_label='')
   }
   elseif ($option_group == 'state') {
     $config = webform_civicrm_get_config();
-    $sql = 'SELECT name AS label, id AS value FROM civicrm_state_province WHERE country_id = '. $config['defaultContactCountry'] .' ORDER BY name';
+    $sql = 'SELECT name AS label, id AS value FROM civicrm_state_province WHERE country_id = ' . $config['defaultContactCountry'] . ' ORDER BY name';
   }
   elseif ($option_group == 'groups' || $option_group == 'mailing_lists') {
     $sql = 'SELECT id AS value, title AS label FROM civicrm_group WHERE is_active = 1';
@@ -279,7 +281,7 @@ function webform_civicrm_get_options($option_group, $var='str', $null_label='')
   $str = '';
   while ($dao->fetch()) {
     $arr[$dao->value] = $dao->label;
-    $str .= ($str?"\n":'') . $dao->value .'|'. $dao->label;
+    $str .= ($str?"\n":'') . $dao->value . '|' . $dao->label;
   }
   return $$var;
 }
@@ -302,8 +304,8 @@ function webform_civicrm_js_options($field_key, $str='') {
     $existing = drupal_explode_tags($str);
     $last_str = trim(array_pop($existing));
     $matches = array();
-    $prefix = count($existing) ? implode(', ', $existing) .', ' : '';
-    $params = array(1 => array('%'.$last_str.'%', 'String'));
+    $prefix = count($existing) ? implode(', ', $existing) . ', ' : '';
+    $params = array(1 => array('%' . $last_str . '%', 'String'));
     $sql = "SELECT name FROM civicrm_tag WHERE is_selectable = 1 AND used_for = 'civicrm_contact' AND name LIKE %1 LIMIT 0, 12";
     $dao =& CRM_Core_DAO::executeQuery($sql, $params);
     while ($dao->fetch()) {
@@ -386,6 +388,7 @@ function webform_civicrm_get_fields($var = 'fields') {
                                 'extra' => array('year_start' => '-100', 'year_end' => '-1', 'timezone' => 'user')),
       'civicrm_job_title'      => array('name' => t('Job Title'), 'type' => 'textfield'),
       'civicrm_contact_id'     => array('name' => t('Contact ID'), 'type' => 'hidden', 'extra' => array('description' => t('(hidden field, useful for post-processing)'))),
+      'civicrm_external_identifier' => array('name' => t('External ID'), 'type' => 'textfield'),
       // Email params -- email must be first!
       'civicrm_email'          => array('name' => t('Email'), 'type' => 'email', 'mandatory' => 1),
       // Address params -- street_address must be first!
@@ -432,6 +435,7 @@ function webform_civicrm_get_fields($var = 'fields') {
       'world_region'        => t('world region'),
       'phone'               => t('phone number'),
       'email'               => t('email'),
+      'external_identifier' => t('external identifier'),
     );
 
     $lists = array(
@@ -471,13 +475,13 @@ function webform_civicrm_get_fields($var = 'fields') {
       if (!$custom_types[$dao->html_type]) {
         continue;
       }
-      $id = 'civicrm_custom_'. $dao->id;
+      $id = 'civicrm_custom_' . $dao->id;
       $label = drupal_strtolower($dao->label);
       // Prevent token namespace collisions
       if (in_array($label, $tokens)) {
-        $label .= ' '. $dao->id;
+        $label .= ' ' . $dao->id;
       }
-      $tokens['custom_'. $dao->id] = $label;
+      $tokens['custom_' . $dao->id] = $label;
       $fields[$id] = $custom_types[$dao->html_type];
       $fields[$id]['name'] = $dao->label;
       $fields[$id]['mandatory'] = $dao->is_required;
@@ -485,8 +489,8 @@ function webform_civicrm_get_fields($var = 'fields') {
       $fields[$id]['value'] = str_replace($sp, ',', trim($dao->default_value, $sp));
       $fields[$id]['custom_group'] = $dao->custom_group_name;
       if ($fields[$id]['type'] == 'date') {
-        $fields[$id]['extra']['year_start'] = $dao->start_date_years ? '-'. $dao->start_date_years : '-50';
-        $fields[$id]['extra']['year_end'] = $dao->end_date_years ? '+'. $dao->end_date_years : '+50';
+        $fields[$id]['extra']['year_start'] = $dao->start_date_years ? '-' . $dao->start_date_years : '-50';
+        $fields[$id]['extra']['year_end'] = $dao->end_date_years ? '+' . $dao->end_date_years : '+50';
       }
       elseif ($og = $dao->option_group_id) {
         $lists[$id] = $og;
@@ -498,7 +502,7 @@ function webform_civicrm_get_fields($var = 'fields') {
         $lists[$id] = 'state';
       }
       elseif ($fields[$id]['type'] == 'select') {
-        $fields[$id]['extra']['items'] = '1|'. t('Yes') ."\n0|". t('No');
+        $fields[$id]['extra']['items'] = '1|' . t('Yes') ."\n0|". t('No');
       }
       elseif ($fields[$id]['type'] == 'textarea') {
         $fields[$id]['extra']['cols'] = $dao->note_columns;
@@ -538,7 +542,7 @@ function webform_civicrm_set_message($message, $contact) {
   if ($matches[0]) {
     foreach ($matches[0] as $pos => $match) {
       if (user_is_logged_in()) {
-        $link = l($matches[1][$pos], 'logout', array('query' => 'destination='. $_GET['q']));
+        $link = l($matches[1][$pos], 'logout', array('query' => 'destination=' . $_GET['q']));
       }
       else {
         $link = l($matches[1][$pos], $_GET['q']);
@@ -561,8 +565,8 @@ function webform_civicrm_mailer_event_subscribe($params) {
   require_once 'CRM/Contact/BAO/Group.php';
   require_once 'CRM/Mailing/Event/BAO/Subscribe.php';
 
-  $email      = $params['email']; 
-  $group_id   = $params['group_id']; 
+  $email      = $params['email'];
+  $group_id   = $params['group_id'];
   $contact_id = $params['contact_id'];
 
   $group = new CRM_Contact_DAO_Group();
@@ -574,7 +578,7 @@ function webform_civicrm_mailer_event_subscribe($params) {
 
   $subscribe = CRM_Mailing_Event_BAO_Subscribe::subscribe($group_id, $email, $contact_id);
 
-  if ($subscribe !== null) {
+  if ($subscribe !== NULL) {
     /* Ask the contact for confirmation */
     $subscribe->send_confirm_request($email);
 
