diff --git a/contrib/location_addanother/location_addanother.install b/contrib/location_addanother/location_addanother.install
index dbc209b..9e712e8 100644
--- a/contrib/location_addanother/location_addanother.install
+++ b/contrib/location_addanother/location_addanother.install
@@ -11,9 +11,11 @@
 function location_addanother_install() {
   // Change weight so we execute after location.
   db_update('system')
-    ->fields(array(
-      'weight' => 1,
-    ))
+    ->fields(
+      array(
+        'weight' => 1,
+      )
+    )
     ->condition('name', 'location_addanother')
     ->condition('type', 'module')
     ->execute();
diff --git a/contrib/location_addanother/location_addanother.module b/contrib/location_addanother/location_addanother.module
index 8d146c9..a64205a 100644
--- a/contrib/location_addanother/location_addanother.module
+++ b/contrib/location_addanother/location_addanother.module
@@ -10,7 +10,11 @@
  * Implements hook_node_view().
  */
 function location_addanother_node_view($node, $view_mode) {
-  if (variable_get('location_addanother_' . $node->type, 0) && count($node->locations) < variable_get('location_maxnum_' . $node->type, 0) && $view_mode == 'full' && node_access('update', $node)) {
+  if (variable_get('location_addanother_' . $node->type, 0) && count($node->locations) < variable_get(
+      'location_maxnum_' . $node->type,
+      0
+    ) && $view_mode == 'full' && node_access('update', $node)
+  ) {
     $addanother_form = drupal_get_form('location_addanother_form', $node);
     $node->content['location_addanother'] = array(
       '#type' => 'markup',
@@ -59,6 +63,7 @@ function location_addanother_form($form, &$form_state, &$node) {
     '#value' => t('Add location'),
     '#weight' => 50,
   );
+
   return $form;
 }
 
@@ -69,8 +74,17 @@ function location_addanother_form_validate($form, &$form_state) {
   $location = $form_state['values']['location'];
   $node = node_load($location['nid']);
   unset($location['nid']);
-  if (!(variable_get('location_addanother_' . $node->type, 0) && count($node->locations) < variable_get('location_maxnum_' . $node->type, 0) && node_access('update', $node))) {
-    form_set_error('location', t("You don't have permission to add a location to this node, or the node has the maximum number of locations already."));
+  if (!(variable_get('location_addanother_' . $node->type, 0) && count($node->locations) < variable_get(
+      'location_maxnum_' . $node->type,
+      0
+    ) && node_access('update', $node))
+  ) {
+    form_set_error(
+      'location',
+      t(
+        "You don't have permission to add a location to this node, or the node has the maximum number of locations already."
+      )
+    );
   }
 }
 
diff --git a/contrib/location_cck/location_cck.module b/contrib/location_cck/location_cck.module
index 70d9e2e..ca3592f 100644
--- a/contrib/location_cck/location_cck.module
+++ b/contrib/location_cck/location_cck.module
@@ -78,7 +78,9 @@ function location_cck_field_settings_form($field, $instance, $has_data) {
       '#title' => t('GMap Macro'),
       '#rows' => 2,
       '#maxlength' => 500,
-      '#description' => t('A macro to be used as a base map for this field.  This map will be recentered on the location, so the center is not that important.'),
+      '#description' => t(
+        'A macro to be used as a base map for this field.  This map will be recentered on the location, so the center is not that important.'
+      ),
       '#default_value' => !empty($field['settings']['gmap_macro']) ? $field['settings']['gmap_macro'] : '[gmap ]',
     );
     $options = gmap_get_marker_titles();
@@ -123,6 +125,7 @@ function location_cck_field_settings($op, $field) {
         'handler' => 'views_handler_relationship',
         'label' => t('Location', array(), array('context' => 'geolocation')), // @@@ Some sort of better name?
       );
+
       return $data;
   }
 }
@@ -348,6 +351,7 @@ function location_cck_field_formatter_info() {
       'field types' => array('location'),
     );
   }
+
   return $info;
 }
 
@@ -487,6 +491,7 @@ function location_cck_field_is_empty($item, $field) {
   if (location_is_empty($item, $fields)) {
     return TRUE;
   }
+
   return FALSE;
 }
 
@@ -495,11 +500,14 @@ function location_cck_field_is_empty($item, $field) {
  */
 function theme_location_cck_field_all($variables) {
   $content = theme('location', array('location' => $variables['location'], 'hide' => $variables['hide']));
-  $content .= theme_location_cck_field_map(array(
-    'locations' => array($variables['location']),
-    'field' => $variables['field'],
-    'instance' => $variables['instance']
-  ));
+  $content .= theme_location_cck_field_map(
+    array(
+      'locations' => array($variables['location']),
+      'field' => $variables['field'],
+      'instance' => $variables['instance']
+    )
+  );
+
   return $content;
 }
 
@@ -512,6 +520,7 @@ function theme_location_cck_formatter_combined($variables) {
 
   $field = content_fields($element['#field_name'], $element['#type_name']);
   $locations = $element['#items'];
+
   return theme_location_cck_field_map(array('locations' => $locations, 'field' => $field));
 }
 
@@ -566,7 +575,9 @@ function theme_location_cck_field_popup($variables) {
   $location = $variables['location'];
   $instance = $variables['instance'];
 
-  $hide = (isset($field['location_settings']['display']['hide'])) ? array_keys(array_filter($field['location_settings']['display']['hide'])) : array();
+  $hide = (isset($field['location_settings']['display']['hide'])) ? array_keys(
+    array_filter($field['location_settings']['display']['hide'])
+  ) : array();
   // Don't use a map link in a popup!
   // We're making the name into a title.
   $hide[] = 'map_link';
@@ -576,6 +587,7 @@ function theme_location_cck_field_popup($variables) {
   if (!empty($location['name'])) {
     $markertitle = $location['name'];
   }
+
   return '<h4>' . $markertitle . '</h4>' . theme('location', array('location' => $location, 'hide' => $hide));
 }
 
@@ -583,52 +595,58 @@ function theme_location_cck_field_popup($variables) {
 /**
  * Implements hook_token_info().
  */
- function location_cck_token_info() {
-   $info = array();
-   
-   // Load all available fields.
-   $entities = field_info_field_map();
-   
-   // Loop through our fields and remove all but location types.
-   foreach ($entities as $key => $value) {
-     if ($value['type'] != 'location') {
-       unset($entities[$key]);
-     }
-   }
-
-   // If we have location fields available, setup our tokens.
-   if(sizeof($entities)) {
-     // Get the available location field names.
-     $fields = location_field_names(TRUE);
-
-     // Loop through the location fields and setup tokens.
-     foreach ($entities as $key => $value) {
-      
+function location_cck_token_info() {
+  $info = array();
+
+  // Load all available fields.
+  $entities = field_info_field_map();
+
+  // Loop through our fields and remove all but location types.
+  foreach ($entities as $key => $value) {
+    if ($value['type'] != 'location') {
+      unset($entities[$key]);
+    }
+  }
+
+  // If we have location fields available, setup our tokens.
+  if (sizeof($entities)) {
+    // Get the available location field names.
+    $fields = location_field_names(TRUE);
+
+    // Loop through the location fields and setup tokens.
+    foreach ($entities as $key => $value) {
+
       $info['tokens']['node'][$key] = array(
         'name' => t('Location field: !field', array('!field' => $key)),
-        'description' => t('Tokens for the field: !field. Replace the "?" with the delta you want. Defaults to delta 0.', array('!field' => $key)),
+        'description' => t(
+          'Tokens for the field: !field. Replace the "?" with the delta you want. Defaults to delta 0.',
+          array('!field' => $key)
+        ),
         'type' => $key,
       );
-     
-       $info['types'][$key] = array(
+
+      $info['types'][$key] = array(
         'name' => t('Location field: !field', array('!field' => $key)),
-        'description' => t('Tokens for the field: !field. Replace the "?" with the delta you want. Defaults to delta 0.', array('!field' => $key)),
+        'description' => t(
+          'Tokens for the field: !field. Replace the "?" with the delta you want. Defaults to delta 0.',
+          array('!field' => $key)
+        ),
         'needs-data' => 'node',
-       );
-       
-       foreach ($fields as $field_key => $field_value) {
-         $info['tokens'][$key][$field_key . ":?"] = array(
+      );
+
+      foreach ($fields as $field_key => $field_value) {
+        $info['tokens'][$key][$field_key . ":?"] = array(
           'name' => t($field_value),
           'description' => t($field_value)
-         );
-       }
-       
-     }
-   }
-
-   return $info;
- }
- 
+        );
+      }
+
+    }
+  }
+
+  return $info;
+}
+
 /**
  * Implements hook_tokens().
  */
@@ -637,7 +655,7 @@ function location_cck_tokens($type, $tokens, array $data = array(), array $optio
   $replacements = array();
 
   // Make sure we have a node.
-  if(isset($data['entity_type']) && $data['entity_type'] == 'node') {
+  if (isset($data['entity_type']) && $data['entity_type'] == 'node') {
 
     $node = $data['entity'];
 
@@ -670,10 +688,10 @@ function location_cck_tokens($type, $tokens, array $data = array(), array $optio
       $position = (isset($pieces[3]) && is_numeric($pieces[3]) ? $pieces[3] : 0);
 
       // If the token is in the $available, replace it.
-      if(array_key_exists($item, $available) && $available[$item]) {
+      if (array_key_exists($item, $available) && $available[$item]) {
         $replacements[$original] = (isset($node->{$field}[LANGUAGE_NONE][$position][$item]) ? $node->{$field}[LANGUAGE_NONE][$position][$item] : '');
       }
-    }  
+    }
   }
 
   return $replacements;
@@ -716,5 +734,6 @@ function location_cck_field_views_data($field) {
       }
     }
   }
+
   return $data;
 }
diff --git a/contrib/location_email/location_email.install b/contrib/location_email/location_email.install
index d0bc02c..5c35b2b 100644
--- a/contrib/location_email/location_email.install
+++ b/contrib/location_email/location_email.install
@@ -39,9 +39,11 @@ function location_email_schema() {
 function location_email_install() {
   // Change weight.
   db_update('system')
-    ->fields(array(
-      'weight' => 1,
-    ))
+    ->fields(
+      array(
+        'weight' => 1,
+      )
+    )
     ->condition('name', 'location_email')
     ->condition('type', 'module')
     ->execute();
diff --git a/contrib/location_email/location_email.module b/contrib/location_email/location_email.module
index a631a86..4e0ab31 100644
--- a/contrib/location_email/location_email.module
+++ b/contrib/location_email/location_email.module
@@ -38,18 +38,24 @@ function location_email_locationapi(&$location, $op, $a3 = NULL, $a4 = NULL) {
         ->execute();
       if (!empty($location['email'])) {
         db_insert('location_email')
-          ->fields(array(
-            'lid' => $location['lid'],
-            'email' => $location['email'],
-          ))
+          ->fields(
+            array(
+              'lid' => $location['lid'],
+              'email' => $location['email'],
+            )
+          )
           ->execute();
       }
       break;
 
     case 'load':
       $fields = array();
-      $email = db_query('SELECT email FROM {location_email} WHERE lid = :lid', array(':lid' => $location['lid']))->fetchField();
+      $email = db_query(
+        'SELECT email FROM {location_email} WHERE lid = :lid',
+        array(':lid' => $location['lid'])
+      )->fetchField();
       $fields['email'] = $email ? $email : '';
+
       return $fields;
 
     case 'delete':
@@ -74,7 +80,10 @@ function location_email_views_api() {
  */
 function location_email_token_list($type = 'all') {
   if ($type == 'node' || $type == 'user' || $type == 'all') {
-    $tokens['location']['location-email_N'] = t('Location Email address (If there are multiple locations per node, N is the iteration, starting with 0)');
+    $tokens['location']['location-email_N'] = t(
+      'Location Email address (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+
     return $tokens;
   }
 }
diff --git a/contrib/location_entity/location_entity.module b/contrib/location_entity/location_entity.module
index 9f9862b..523dbe2 100644
--- a/contrib/location_entity/location_entity.module
+++ b/contrib/location_entity/location_entity.module
@@ -39,6 +39,7 @@ function location_entity_field_verbatim_get($item, array $options, $name, $entit
   if (isset($item[$name]) && !empty($item[$name])) {
     return $item[$name];
   }
+
   return NULL;
 }
 
diff --git a/contrib/location_fax/location_fax.install b/contrib/location_fax/location_fax.install
index 6343a0c..6369c40 100644
--- a/contrib/location_fax/location_fax.install
+++ b/contrib/location_fax/location_fax.install
@@ -39,9 +39,11 @@ function location_fax_schema() {
 function location_fax_install() {
   // Change weight so we execute after location.
   db_update('system')
-    ->fields(array(
-      'weight' => 1,
-    ))
+    ->fields(
+      array(
+        'weight' => 1,
+      )
+    )
     ->condition('name', 'location_fax')
     ->condition('type', 'module')
     ->execute();
@@ -93,9 +95,11 @@ function location_fax_update_5301() {
 function location_fax_update_5302() {
   // Change weight.
   db_update('system')
-    ->fields(array(
-      'weight' => 1,
-    ))
+    ->fields(
+      array(
+        'weight' => 1,
+      )
+    )
     ->condition('name', 'location_fax')
     ->condition('type', 'module')
     ->execute();
@@ -105,11 +109,16 @@ function location_fax_update_5302() {
  * Drupal 6 updates.
  */
 function location_fax_update_6301() {
-  db_change_field('location_fax', 'fax', 'fax', array(
-    'description' => 'Fax number',
-    'type' => 'varchar',
-    'length' => 31,
-    'not null' => TRUE,
-    'default' => '',
-  ));
+  db_change_field(
+    'location_fax',
+    'fax',
+    'fax',
+    array(
+      'description' => 'Fax number',
+      'type' => 'varchar',
+      'length' => 31,
+      'not null' => TRUE,
+      'default' => '',
+    )
+  );
 }
diff --git a/contrib/location_fax/location_fax.module b/contrib/location_fax/location_fax.module
index a1bc647..18f13a4 100644
--- a/contrib/location_fax/location_fax.module
+++ b/contrib/location_fax/location_fax.module
@@ -38,18 +38,22 @@ function location_fax_locationapi(&$location, $op, $a3 = NULL, $a4 = NULL) {
         ->execute();
       if (!empty($location['fax'])) {
         db_insert('location_fax')
-          ->fields(array(
-            'lid' => $location['lid'],
-            'fax' => $location['fax'],
-          ))
+          ->fields(
+            array(
+              'lid' => $location['lid'],
+              'fax' => $location['fax'],
+            )
+          )
           ->execute();
       }
       break;
 
     case 'load':
       $fields = array();
-      $fax = db_query('SELECT fax FROM {location_fax} WHERE lid = :lid', array(':lid' => $location['lid']))->fetchField();
+      $fax = db_query('SELECT fax FROM {location_fax} WHERE lid = :lid', array(':lid' => $location['lid']))->fetchField(
+      );
       $fields['fax'] = $fax ? $fax : '';
+
       return $fields;
 
     case 'delete':
@@ -74,7 +78,10 @@ function location_fax_views_api() {
  */
 function location_fax_token_list($type = 'all') {
   if ($type == 'node' || $type == 'user' || $type == 'all') {
-    $tokens['location']['location-fax_N'] = t('Location Fax number (If there are multiple locations per node, N is the iteration, starting with 0)');
+    $tokens['location']['location-fax_N'] = t(
+      'Location Fax number (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+
     return $tokens;
   }
 }
diff --git a/contrib/location_phone/location_phone.install b/contrib/location_phone/location_phone.install
index a793100..e459715 100644
--- a/contrib/location_phone/location_phone.install
+++ b/contrib/location_phone/location_phone.install
@@ -39,9 +39,11 @@ function location_phone_schema() {
 function location_phone_install() {
   // Change weight.
   db_update('system')
-    ->fields(array(
-      'weight' => 1,
-    ))
+    ->fields(
+      array(
+        'weight' => 1,
+      )
+    )
     ->condition('name', 'location_phone')
     ->condition('type', 'module')
     ->execute();
@@ -98,9 +100,11 @@ function location_phone_update_5301() {
 function location_phone_update_5302() {
   // Change weight.
   db_update('system')
-    ->fields(array(
-      'weight' => 1,
-    ))
+    ->fields(
+      array(
+        'weight' => 1,
+      )
+    )
     ->condition('name', 'location_phone')
     ->condition('type', 'module')
     ->execute();
@@ -110,11 +114,16 @@ function location_phone_update_5302() {
  * Drupal 6 updates.
  */
 function location_phone_update_6301() {
-  db_change_field('location_phone', 'phone', 'phone', array(
-    'description' => 'Phone number',
-    'type' => 'varchar',
-    'length' => 31,
-    'not null' => TRUE,
-    'default' => '',
-  ));
+  db_change_field(
+    'location_phone',
+    'phone',
+    'phone',
+    array(
+      'description' => 'Phone number',
+      'type' => 'varchar',
+      'length' => 31,
+      'not null' => TRUE,
+      'default' => '',
+    )
+  );
 }
diff --git a/contrib/location_phone/location_phone.module b/contrib/location_phone/location_phone.module
index 14f3ab2..af163f6 100644
--- a/contrib/location_phone/location_phone.module
+++ b/contrib/location_phone/location_phone.module
@@ -38,18 +38,24 @@ function location_phone_locationapi(&$location, $op, $a3 = NULL, $a4 = NULL) {
         ->execute();
       if (!empty($location['phone'])) {
         db_insert('location_phone')
-          ->fields(array(
-            'lid' => $location['lid'],
-            'phone' => $location['phone'],
-          ))
+          ->fields(
+            array(
+              'lid' => $location['lid'],
+              'phone' => $location['phone'],
+            )
+          )
           ->execute();
       }
       break;
 
     case 'load':
       $fields = array();
-      $phone = db_query('SELECT phone FROM {location_phone} WHERE lid = :lid', array(':lid' => $location['lid']))->fetchField();
+      $phone = db_query(
+        'SELECT phone FROM {location_phone} WHERE lid = :lid',
+        array(':lid' => $location['lid'])
+      )->fetchField();
       $fields['phone'] = $phone ? $phone : '';
+
       return $fields;
 
     case 'delete':
@@ -74,7 +80,10 @@ function location_phone_views_api() {
  */
 function location_phone_token_list($type = 'all') {
   if ($type == 'node' || $type == 'user' || $type == 'all') {
-    $tokens['location']['location-phone_N'] = t('Location Phone number (If there are multiple locations per node, N is the iteration, starting with 0)');
+    $tokens['location']['location-phone_N'] = t(
+      'Location Phone number (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+
     return $tokens;
   }
 }
diff --git a/contrib/location_search/location_search.admin.inc b/contrib/location_search/location_search.admin.inc
index 65dc346..20573a8 100644
--- a/contrib/location_search/location_search.admin.inc
+++ b/contrib/location_search/location_search.admin.inc
@@ -17,7 +17,9 @@ function location_search_admin_settings($form, &$form_state) {
     '#title' => t('Use map to pick search coordinates'),
     '#return_value' => 1,
     '#default_value' => variable_get('location_search_map', 1),
-    '#description' => $gmap ? t('Requires the gmap module.') : t('You must install the gmap module to enable this feature.'),
+    '#description' => $gmap ? t('Requires the gmap module.') : t(
+        'You must install the gmap module to enable this feature.'
+      ),
     '#disabled' => !$gmap,
   );
   $form['location_search_map_address'] = array(
diff --git a/contrib/location_search/location_search.module b/contrib/location_search/location_search.module
index f99e525..4a06ab4 100644
--- a/contrib/location_search/location_search.module
+++ b/contrib/location_search/location_search.module
@@ -75,6 +75,7 @@ function location_search_search_reset() {
 function location_search_search_status() {
   $total = db_query('SELECT COUNT(lid) FROM {location}')->fetchField();
   $remaining = db_query('SELECT COUNT(lid) FROM {location_search_work}')->fetchField();
+
   return array('remaining' => $remaining, 'total' => $total);
 }
 
@@ -197,7 +198,11 @@ function location_search_search_execute($keys = NULL, $conditions = NULL) {
   foreach ($lids as $lid) {
     $loc = location_load_location($lid);
 
-    $result = db_query('SELECT nid, uid, genid FROM {location_instance} WHERE lid = :lid', array(':lid' => $lid), array('fetch' => PDO::FETCH_ASSOC));
+    $result = db_query(
+      'SELECT nid, uid, genid FROM {location_instance} WHERE lid = :lid',
+      array(':lid' => $lid),
+      array('fetch' => PDO::FETCH_ASSOC)
+    );
     $instance_links = array();
     foreach ($result as $row) {
       $instance_links[] = $row;
@@ -210,6 +215,7 @@ function location_search_search_execute($keys = NULL, $conditions = NULL) {
     );
 
   }
+
   return $results;
 }
 
@@ -265,12 +271,17 @@ function location_search_add_access_control(&$query) {
     // If we pass in the subselect query object then when the pager query is
     // run later on the node_access alterations don't get applied to the
     // subselect. So instead we pass in the array result set.
-    $query->condition(db_or()
-      ->condition('li.uid', 0, '<>')
-      ->condition(db_and()
-        ->condition('li.nid', 0, '<>')
-        ->condition('n.nid', $subselect->execute()->fetchCol(), 'IN')));
+    $query->condition(
+      db_or()
+        ->condition('li.uid', 0, '<>')
+        ->condition(
+          db_and()
+            ->condition('li.nid', 0, '<>')
+            ->condition('n.nid', $subselect->execute()->fetchCol(), 'IN')
+        )
+    );
   }
+
   return TRUE;
 }
 
@@ -370,7 +381,11 @@ function location_search_form_alter(&$form, &$form_state, $form_id) {
         $map_fields['address'] = 'locpick_address';
       }
       if (module_exists('gmap')) {
-        $form['advanced']['proximity']['map']['#value'] = gmap_set_location(variable_get('location_search_map_macro', '[gmap |behavior=+collapsehack]'), $form['advanced']['proximity'], $map_fields);
+        $form['advanced']['proximity']['map']['#value'] = gmap_set_location(
+          variable_get('location_search_map_macro', '[gmap |behavior=+collapsehack]'),
+          $form['advanced']['proximity'],
+          $map_fields
+        );
       }
     }
 
@@ -395,7 +410,11 @@ function location_search_validate($form, &$form_state) {
     $keys = search_expression_insert($keys, 'country', $values['country']);
 
     if (!empty($values['province'])) {
-      $keys = search_expression_insert($keys, 'province', location_province_code($values['country'], $values['province']));
+      $keys = search_expression_insert(
+        $keys,
+        'province',
+        location_province_code($values['country'], $values['province'])
+      );
     }
   }
 
@@ -404,7 +423,11 @@ function location_search_validate($form, &$form_state) {
   }
 
   if (!empty($values['latitude']) && !empty($values['longitude']) && !empty($values['distance'])) {
-    $keys = search_expression_insert($keys, 'from', $values['latitude'] . ',' . $values['longitude'] . ',' . $values['distance'] . ',' . $values['units']);
+    $keys = search_expression_insert(
+      $keys,
+      'from',
+      $values['latitude'] . ',' . $values['longitude'] . ',' . $values['distance'] . ',' . $values['units']
+    );
   }
 
   if (!empty($keys)) {
@@ -440,9 +463,11 @@ function location_search_locationapi(&$obj, $op, $a3 = NULL, $a4 = NULL, $a5 = N
       ->condition('lid', $obj['lid'])
       ->execute();
     db_insert('location_search_work')
-      ->fields(array(
-        'lid' => $obj['lid'],
-      ))
+      ->fields(
+        array(
+          'lid' => $obj['lid'],
+        )
+      )
       ->execute();
   }
   if ($op == 'delete') {
diff --git a/contrib/location_taxonomy/location_taxonomy.module b/contrib/location_taxonomy/location_taxonomy.module
index 8134200..c787e7e 100644
--- a/contrib/location_taxonomy/location_taxonomy.module
+++ b/contrib/location_taxonomy/location_taxonomy.module
@@ -93,7 +93,10 @@ function location_taxonomy_vocabulary_form_submit($form, &$form_state) {
 function location_taxonomy_term_form_submit($form, &$form_state) {
   $settings = variable_get('location_taxonomy_' . $form_state['values']['vid'], FALSE);
   if ($settings && $settings['multiple']['max']) {
-    location_save_locations($form_state['values']['locations'], array('genid' => 'taxonomy:' . $form_state['values']['tid']));
+    location_save_locations(
+      $form_state['values']['locations'],
+      array('genid' => 'taxonomy:' . $form_state['values']['tid'])
+    );
   }
 }
 
diff --git a/earth.inc b/earth.inc
index 78c056c..c02e844 100644
--- a/earth.inc
+++ b/earth.inc
@@ -57,6 +57,7 @@ function earth_radius($latitude = 37.9) {
 
   $x = cos($lat) / earth_radius_semimajor();
   $y = sin($lat) / earth_radius_semiminor();
+
   return 1 / (sqrt($x * $x + $y * $y));
 }
 
@@ -76,6 +77,7 @@ function earth_xyz($longitude, $latitude, $height = 0) {
   $x = ($radius + $height) * $coslat * $coslong;
   $y = ($radius + $height) * $coslat * $sinlong;
   $z = ($radius * (1 - earth_eccentricity_sq()) + $height) * $sinlat;
+
   return array($x, $y, $z);
 }
 
@@ -95,6 +97,7 @@ function earth_distance($longitude1, $latitude1, $longitude2, $latitude2) {
   $cosangle = cos($lat1) * cos($lat2) *
     (cos($long1) * cos($long2) + sin($long1) * sin($long2)) +
     sin($lat1) * sin($lat2);
+
   return acos($cosangle) * $radius;
 }
 
@@ -119,6 +122,7 @@ function earth_distance_sql($longitude, $latitude, $tbl_alias = '') {
   $coslat = cos($lat);
   $sinlong = sin($long);
   $sinlat = sin($lat);
+
   return "(COALESCE(ACOS($coslat*COS(RADIANS({$tbl_alias}latitude))*($coslong*COS(RADIANS({$tbl_alias}longitude)) + $sinlong*SIN(RADIANS({$tbl_alias}longitude))) + $sinlat*SIN(RADIANS({$tbl_alias}latitude))), 0.00000)*$radius)";
 }
 
@@ -149,6 +153,7 @@ function earth_longitude_range($longitude, $latitude, $distance) {
   if ($maxlong > pi()) {
     $maxlong = $maxlong - pi() * 2;
   }
+
   return array(rad2deg($minlong), rad2deg($maxlong));
 }
 
@@ -178,6 +183,7 @@ function earth_latitude_range($longitude, $latitude, $distance) {
     }
     $maxlat = $rightangle;
   }
+
   return array(rad2deg($minlat), rad2deg($maxlat));
 }
 
diff --git a/geocoding/google.inc b/geocoding/google.inc
index 36059a5..3b74878 100755
--- a/geocoding/google.inc
+++ b/geocoding/google.inc
@@ -12,7 +12,9 @@
  */
 function google_geocode_country_list_xml() {
   // Get the google data from the feed.
-  $source = drupal_http_request('http://spreadsheets.google.com/feeds/list/p9pdwsai2hDMsLkXsoM05KQ/default/public/values');
+  $source = drupal_http_request(
+    'http://spreadsheets.google.com/feeds/list/p9pdwsai2hDMsLkXsoM05KQ/default/public/values'
+  );
 
   if (!$source->data) {
     // Use the cache.
@@ -72,13 +74,16 @@ function google_geocode_country_list() {
   $countries = location_get_iso3166_list();
   $regex = "#[ (].*[)]#";
   $cntryclean = preg_replace($regex, "", $countries);
-  $countriesfixes = array_merge($cntryclean, array(
-    "hk" => t("China"),
-    "mo" => t("China"),
-    "pn" => t("Pitcairn Islands"),
-    "wf" => t("Wallis Futuna"),
-    "st" => t("S&Atilde;&pound;o Tom&Atilde;&copy; and Pr&Atilde;&shy;ncipe"),
-  ));
+  $countriesfixes = array_merge(
+    $cntryclean,
+    array(
+      "hk" => t("China"),
+      "mo" => t("China"),
+      "pn" => t("Pitcairn Islands"),
+      "wf" => t("Wallis Futuna"),
+      "st" => t("S&Atilde;&pound;o Tom&Atilde;&copy; and Pr&Atilde;&shy;ncipe"),
+    )
+  );
 
   // Compare new google data found to fixed country name values and return
   // matches with abbreviations as keys.
@@ -87,6 +92,7 @@ function google_geocode_country_list() {
   // Compare new keys to original Drupal API and return the array with the
   // original name values.
   $fixedkeys = array_intersect_key($countries, $googlematched);
+
   return array_keys($fixedkeys);
 }
 
@@ -126,14 +132,18 @@ function google_geocode_location($location = array()) {
     // If we have only a country code and nothing else,
     // pass in country component so that google doesn't mistake the country
     // code for some other short code, like administrative area.
-    $filtered_location = array_filter($location, function($a) {
-      // Handle locpick & settings arrays.
-      // No actual location data should be in an array.
-      if (is_array($a)) {
-        return FALSE;
+    $filtered_location = array_filter(
+      $location,
+      function ($a) {
+        // Handle locpick & settings arrays.
+        // No actual location data should be in an array.
+        if (is_array($a)) {
+          return FALSE;
+        }
+
+        return is_string($a) ? trim($a) : $a;
       }
-      return is_string($a) ? trim($a) : $a;
-    });
+    );
     if (count($filtered_location) == 1) {
       $query['components'] = _google_geocode_get_components($filtered_location);
     }
@@ -143,14 +153,17 @@ function google_geocode_location($location = array()) {
   if (empty($key) && function_exists('gmap_get_key')) {
     $key = gmap_get_key();
   }
-  if(!empty($key)) {
+  if (!empty($key)) {
     $query['key'] = $key;
   }
 
-  $url = url('https://maps.googleapis.com/maps/api/geocode/json', array(
-    'query' => $query,
-    'external' => TRUE,
-  ));
+  $url = url(
+    'https://maps.googleapis.com/maps/api/geocode/json',
+    array(
+      'query' => $query,
+      'external' => TRUE,
+    )
+  );
 
   $http_reply = drupal_http_request($url);
   $delay_trigger = TRUE;
@@ -158,10 +171,15 @@ function google_geocode_location($location = array()) {
 
   $status_code = $data->status;
   if ($status_code != 'OK') {
-    watchdog('location', 'Google geocoding returned status code: %status_code for the query url: %url', array(
-      '%status_code' => $data->status,
-      '%url' => $url
-    ));
+    watchdog(
+      'location',
+      'Google geocoding returned status code: %status_code for the query url: %url',
+      array(
+        '%status_code' => $data->status,
+        '%url' => $url
+      )
+    );
+
     return NULL;
   }
   $location = $data->results[0]->geometry->location;
@@ -181,16 +199,21 @@ function google_geocode_settings() {
     '#size' => 64,
     '#maxlength' => 128,
     '#default_value' => variable_get('location_geocode_google_apikey', ''),
-    '#description' => t('In order to use the Google Geocoding API web-service, you will need a Google Geocoding API Server Key.  You can obtain one at the !sign_up_link for the !google_maps_api.  Without a key daily requests from a single IP address will be automaticaly limited.  If you do not enter a key here this module will use the Google Maps API Key from gmap if one is present. NOTE: You will <em>not</em> have to re-enter your API key for each country for which you have selected Google Maps for geocoding.  This setting is global.', array(
-      '!sign_up_link' => '<a href="http://console.developers.google.com/">sign-up page</a>',
-      '!google_maps_api' => '<a href="http://developers.google.com/maps/documentation/geocoding/">Google Geocoding API</a>'
-    ))
+    '#description' => t(
+      'In order to use the Google Geocoding API web-service, you will need a Google Geocoding API Server Key.  You can obtain one at the !sign_up_link for the !google_maps_api.  Without a key daily requests from a single IP address will be automaticaly limited.  If you do not enter a key here this module will use the Google Maps API Key from gmap if one is present. NOTE: You will <em>not</em> have to re-enter your API key for each country for which you have selected Google Maps for geocoding.  This setting is global.',
+      array(
+        '!sign_up_link' => '<a href="http://console.developers.google.com/">sign-up page</a>',
+        '!google_maps_api' => '<a href="http://developers.google.com/maps/documentation/geocoding/">Google Geocoding API</a>'
+      )
+    )
   );
 
   $form['location_geocode_google_delay'] = array(
     '#type' => 'textfield',
     '#title' => t('Delay between geocoding requests (is milliseconds)'),
-    '#description' => t('To avoid a 620 error (denial of service) from Google, you can add a delay between geocoding requests. 200ms is recommended.'),
+    '#description' => t(
+      'To avoid a 620 error (denial of service) from Google, you can add a delay between geocoding requests. 200ms is recommended.'
+    ),
     '#default_value' => variable_get('location_geocode_google_delay', 0),
     '#size' => 10,
   );
@@ -200,11 +223,15 @@ function google_geocode_settings() {
     $form['location_geocode_' . $country . '_google_accuracy_code'] = array(
       '#type' => 'select',
       '#title' => t('Google Maps Geocoding Accuracy for %country', array('%country' => $country)),
-      '#default_value' => variable_get('location_geocode_' . $country . '_google_accuracy_code', variable_get('location_geocode_google_minimum_accuracy', '3')),
+      '#default_value' => variable_get(
+        'location_geocode_' . $country . '_google_accuracy_code',
+        variable_get('location_geocode_google_minimum_accuracy', '3')
+      ),
       '#options' => location_google_geocode_accuracy_codes(),
       '#description' => t('The minimum required accuracy for the geolocation data to be saved.'),
     );
   }
+
   return $form;
 }
 
diff --git a/handlers/location_handler_argument_location_country.inc b/handlers/location_handler_argument_location_country.inc
index 6edc5e1..b9c73ef 100644
--- a/handlers/location_handler_argument_location_country.inc
+++ b/handlers/location_handler_argument_location_country.inc
@@ -16,6 +16,7 @@ class location_handler_argument_location_country extends views_handler_argument
     if (empty($value)) {
       return t('Unknown');
     }
+
     return location_country_name($value);
   }
 }
diff --git a/handlers/location_handler_argument_location_province.inc b/handlers/location_handler_argument_location_province.inc
index 8a23acd..f70c0d2 100644
--- a/handlers/location_handler_argument_location_province.inc
+++ b/handlers/location_handler_argument_location_province.inc
@@ -8,6 +8,7 @@ class location_handler_argument_location_province extends views_handler_argument
   function option_definition() {
     $options = parent::option_definition();
     $options['break_phrase'] = array('default' => FALSE);
+
     return $options;
   }
 
@@ -62,6 +63,7 @@ class location_handler_argument_location_province extends views_handler_argument
     foreach ($values as $value) {
       $title .= location_province_name($country, $value) . ", ";
     }
+
     return substr($title, 0, -2);
   }
 
diff --git a/handlers/location_handler_argument_location_proximity.inc b/handlers/location_handler_argument_location_proximity.inc
index 924f81f..95776c7 100644
--- a/handlers/location_handler_argument_location_proximity.inc
+++ b/handlers/location_handler_argument_location_proximity.inc
@@ -16,6 +16,7 @@ class location_handler_argument_location_proximity extends views_handler_argumen
     $options['search_units'] = array('default' => ($country == 'us' || $country == 'uk' ? 'mile' : 'km'));
     $options['search_method'] = array('default' => 'mbr');
     $options['type'] = array('default' => 'postal');
+
     return $options;
   }
 
@@ -32,7 +33,11 @@ class location_handler_argument_location_proximity extends views_handler_argumen
         'latlon' => t('Decimal Latitude and Longitude coordinates, comma delimited'),
       ),
       '#default_value' => $this->options['type'],
-      '#description' => t('Type of center point.') . '<br />' . t('Postal code argument format: country_postcode_distance or postcode_distance') . '<br />' . t('Lat/Lon argument format: lat,lon_distance') . '<br />' . t('where distance is either a number or a comma delimited pair of decimal degrees'),
+      '#description' => t('Type of center point.') . '<br />' . t(
+          'Postal code argument format: country_postcode_distance or postcode_distance'
+        ) . '<br />' . t('Lat/Lon argument format: lat,lon_distance') . '<br />' . t(
+          'where distance is either a number or a comma delimited pair of decimal degrees'
+        ),
     );
 
     // Units used.
@@ -57,7 +62,9 @@ class location_handler_argument_location_proximity extends views_handler_argumen
         'mbr' => t('Rectangular Proximity'),
       ),
       '#default_value' => $this->options['search_method'],
-      '#description' => t('Method of determining proximity. Note that Circular Proximity does not work with Decimal degrees.'),
+      '#description' => t(
+        'Method of determining proximity. Note that Circular Proximity does not work with Decimal degrees.'
+      ),
     );
   }
 
@@ -95,6 +102,7 @@ class location_handler_argument_location_proximity extends views_handler_argumen
         return FALSE;
       }
     }
+
     return TRUE;
   }
 
@@ -142,6 +150,7 @@ class location_handler_argument_location_proximity extends views_handler_argumen
         // Force nothing to match.
         $this->query->add_where(0, "1 = 0");
       }
+
       return;
     }
 
@@ -179,16 +188,24 @@ class location_handler_argument_location_proximity extends views_handler_argumen
     else {
       $where = "$this->table_alias.latitude > :minlat AND $this->table_alias.latitude < :maxlat AND $this->table_alias.longitude > :minlon AND $this->table_alias.longitude < :maxlon";
     }
-    $this->query->add_where_expression(0, $where, array(
-      ':minlat' => $latrange[0],
-      ':maxlat' => $latrange[1],
-      ':minlon' => $lonrange[0],
-      ':maxlon' => $lonrange[1]
-    ));
+    $this->query->add_where_expression(
+      0,
+      $where,
+      array(
+        ':minlat' => $latrange[0],
+        ':maxlat' => $latrange[1],
+        ':minlon' => $lonrange[0],
+        ':maxlon' => $lonrange[1]
+      )
+    );
 
     if ($this->options['search_method'] == 'dist') {
       // Add radius check.
-      $this->query->add_where_expression(0, earth_distance_sql($lon, $lat, $this->table_alias) . ' < :distance', array(':distance' => $distance_meters));
+      $this->query->add_where_expression(
+        0,
+        earth_distance_sql($lon, $lat, $this->table_alias) . ' < :distance',
+        array(':distance' => $distance_meters)
+      );
     }
   }
 }
diff --git a/handlers/location_handler_field_location_additional.inc b/handlers/location_handler_field_location_additional.inc
index f6fa1c6..dcf1cf6 100644
--- a/handlers/location_handler_field_location_additional.inc
+++ b/handlers/location_handler_field_location_additional.inc
@@ -5,12 +5,12 @@
  * @file
  * Additional field handler.
  */
-
 class location_handler_field_location_additional extends views_handler_field {
 
   function option_definition() {
     $options = parent::option_definition();
     $options['style'] = array('default' => 'name');
+
     return $options;
   }
 
diff --git a/handlers/location_handler_field_location_address.inc b/handlers/location_handler_field_location_address.inc
index 9ea3a73..780182c 100644
--- a/handlers/location_handler_field_location_address.inc
+++ b/handlers/location_handler_field_location_address.inc
@@ -4,12 +4,12 @@
  * @file
  * Field handler to display a complete address.
  */
-
 class location_handler_field_location_address extends views_handler_field {
 
   function option_definition() {
     $options = parent::option_definition();
     $options['hide'] = array('default' => array());
+
     return $options;
   }
 
diff --git a/handlers/location_handler_field_location_country.inc b/handlers/location_handler_field_location_country.inc
index f6a3dd5..effcfc5 100644
--- a/handlers/location_handler_field_location_country.inc
+++ b/handlers/location_handler_field_location_country.inc
@@ -4,12 +4,12 @@
  * @file
  * Country field handler.
  */
-
 class location_handler_field_location_country extends views_handler_field {
 
   function option_definition() {
     $options = parent::option_definition();
     $options['style'] = array('default' => 'name');
+
     return $options;
   }
 
diff --git a/handlers/location_handler_field_location_distance.inc b/handlers/location_handler_field_location_distance.inc
index c12ebcb..806edc9 100644
--- a/handlers/location_handler_field_location_distance.inc
+++ b/handlers/location_handler_field_location_distance.inc
@@ -4,7 +4,6 @@
  * @file
  * Coordinates field handler.
  */
-
 class location_handler_field_location_distance extends views_handler_field {
 
   function option_definition() {
@@ -19,6 +18,7 @@ class location_handler_field_location_distance extends views_handler_field {
     $options['nid_arg'] = array('default' => '');
     $options['nid_loc_field'] = array('default' => 'node');
     $options['uid_arg'] = array('default' => '');
+
     return $options;
   }
 
@@ -51,7 +51,9 @@ class location_handler_field_location_distance extends views_handler_field {
         'uid_arg' => t("User's Latitude / Longitude from views uid argument"),
         'distance_arg' => t("Latitude / Longitude from views argument"),
       ),
-      '#description' => t("This will be the way the latitude/longitude of origin is determined. When using the user's latitude / longitude, if a user has multiple locations the first will be used."),
+      '#description' => t(
+        "This will be the way the latitude/longitude of origin is determined. When using the user's latitude / longitude, if a user has multiple locations the first will be used."
+      ),
       '#default_value' => $this->options['origin'],
     );
 
@@ -94,7 +96,9 @@ class location_handler_field_location_distance extends views_handler_field {
       '#default_value' => $this->options['php_code'],
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('php')),
-      '#description' => t("Enter PHP code that returns a latitude/longitude.  Do not use &lt;?php ?&gt;. You must return only an array with float values set for the 'latitude' and 'longitude' keys."),
+      '#description' => t(
+        "Enter PHP code that returns a latitude/longitude.  Do not use &lt;?php ?&gt;. You must return only an array with float values set for the 'latitude' and 'longitude' keys."
+      ),
     );
 
     list($nid_argument_options, $uid_argument_options) = location_views_proximity_get_argument_options($this->view);
@@ -105,7 +109,11 @@ class location_handler_field_location_distance extends views_handler_field {
       '#title' => t('Node ID argument to use'),
       '#options' => $nid_argument_options,
       '#default_value' => $this->options['nid_arg'],
-      '#description' => empty($nid_argument_options) ? t("Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID. You must have added arguments to the view to use this option.") : t("Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID."),
+      '#description' => empty($nid_argument_options) ? t(
+          "Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID. You must have added arguments to the view to use this option."
+        ) : t(
+          "Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID."
+        ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('nid_arg')),
     );
@@ -114,7 +122,9 @@ class location_handler_field_location_distance extends views_handler_field {
       '#title' => t('Location to use'),
       '#options' => $nid_loc_field_options,
       '#default_value' => $this->options['nid_loc_field'],
-      '#description' => t("Select which of the node's locations to use as the origin.  Either the node locations or a CCK location field.  If the location supports multiple entries the first one will be used."),
+      '#description' => t(
+        "Select which of the node's locations to use as the origin.  Either the node locations or a CCK location field.  If the location supports multiple entries the first one will be used."
+      ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('nid_arg')),
     );
@@ -123,7 +133,11 @@ class location_handler_field_location_distance extends views_handler_field {
       '#title' => t('User ID argument to use'),
       '#options' => $uid_argument_options,
       '#default_value' => $this->options['uid_arg'],
-      '#description' => empty($uid_argument_options) ? t("Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID. You must have added arguments to the view to use this option.") : t("Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID."),
+      '#description' => empty($uid_argument_options) ? t(
+          "Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID. You must have added arguments to the view to use this option."
+        ) : t(
+          "Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID."
+        ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('uid_arg')),
     );
@@ -133,7 +147,12 @@ class location_handler_field_location_distance extends views_handler_field {
     $location = location_views_proximity_get_reference_location($this->view, $this->options);
 
     if (!empty($location)) {
-      $this->query->add_orderby(NULL, earth_distance_sql($location['longitude'], $location['latitude'], $this->table_alias), $order, $this->field_alias);
+      $this->query->add_orderby(
+        NULL,
+        earth_distance_sql($location['longitude'], $location['latitude'], $this->table_alias),
+        $order,
+        $this->field_alias
+      );
     }
   }
 
@@ -145,10 +164,12 @@ class location_handler_field_location_distance extends views_handler_field {
     $dist = (float) $values->{$this->field_alias};
     if ($this->options['units'] == 'km') {
       $dist = $dist / 1000.0;
+
       return theme('location_distance', array('distance' => $dist, 'units' => 'km'));
     }
     else {
       $dist = $dist / 1609.347;
+
       return theme('location_distance', array('distance' => $dist, 'units' => 'mi'));
     }
   }
@@ -159,7 +180,11 @@ class location_handler_field_location_distance extends views_handler_field {
     $coordinates = location_views_proximity_get_reference_location($this->view, $this->options);
 
     if (!empty($coordinates)) {
-      $this->field_alias = $this->query->add_field(NULL, earth_distance_sql($coordinates['longitude'], $coordinates['latitude'], $this->table_alias), $this->table_alias . '_' . $this->field);
+      $this->field_alias = $this->query->add_field(
+        NULL,
+        earth_distance_sql($coordinates['longitude'], $coordinates['latitude'], $this->table_alias),
+        $this->table_alias . '_' . $this->field
+      );
     }
     else {
       $this->field_alias = $this->query->add_field(NULL, "'Unknown'", $this->table_alias . '_' . $this->field);
diff --git a/handlers/location_handler_field_location_province.inc b/handlers/location_handler_field_location_province.inc
index c2d7ad7..ca5242d 100644
--- a/handlers/location_handler_field_location_province.inc
+++ b/handlers/location_handler_field_location_province.inc
@@ -4,7 +4,6 @@
  * @file
  * Province field handler.
  */
-
 class location_handler_field_location_province extends views_handler_field {
 
   function construct() {
@@ -17,6 +16,7 @@ class location_handler_field_location_province extends views_handler_field {
   function option_definition() {
     $options = parent::option_definition();
     $options['style'] = array('default' => 'name');
+
     return $options;
   }
 
@@ -32,7 +32,9 @@ class location_handler_field_location_province extends views_handler_field {
 
   function render($values) {
     if ($this->options['style'] == 'name') {
-      return t(check_plain(location_province_name($values->{$this->aliases['country']}, $values->{$this->field_alias})));
+      return t(
+        check_plain(location_province_name($values->{$this->aliases['country']}, $values->{$this->field_alias}))
+      );
     }
     else {
       //If we get a number for the province, there is not a "proper" code, we must us it's name.
diff --git a/handlers/location_handler_field_location_street.inc b/handlers/location_handler_field_location_street.inc
index 0d22563..a16baff 100644
--- a/handlers/location_handler_field_location_street.inc
+++ b/handlers/location_handler_field_location_street.inc
@@ -4,7 +4,6 @@
  * @file
  * Province field handler.
  */
-
 class location_handler_field_location_street extends views_handler_field {
 
   function construct() {
@@ -17,6 +16,7 @@ class location_handler_field_location_street extends views_handler_field {
   function option_definition() {
     $options = parent::option_definition();
     $options['style'] = array('default' => 'both');
+
     return $options;
   }
 
@@ -45,6 +45,7 @@ class location_handler_field_location_street extends views_handler_field {
         $parts[] = check_plain($values->{$this->aliases['additional']});
       }
     }
+
     // @@@ Better theming?
     return implode('<br />', $parts);
   }
diff --git a/handlers/location_handler_filter_location_country.inc b/handlers/location_handler_filter_location_country.inc
index d6da75b..3aaf841 100644
--- a/handlers/location_handler_filter_location_country.inc
+++ b/handlers/location_handler_filter_location_country.inc
@@ -8,6 +8,7 @@ class location_handler_filter_location_country extends views_handler_filter_in_o
   function option_definition() {
     $options = parent::option_definition();
     $options['operator'] = array('default' => 'in');
+
     return $options;
   }
 
@@ -89,8 +90,10 @@ class location_handler_filter_location_country extends views_handler_filter_in_o
       foreach ($this->options['value'] as $value) {
         $reduced_options[$value] = $this->value_options[$value];
       }
+
       return $reduced_options;
     }
+
     return $this->get_value_options();
   }
 
diff --git a/handlers/location_handler_filter_location_province.inc b/handlers/location_handler_filter_location_province.inc
index a02c7a5..bbd4b25 100644
--- a/handlers/location_handler_filter_location_province.inc
+++ b/handlers/location_handler_filter_location_province.inc
@@ -12,6 +12,7 @@ class location_handler_filter_location_province extends views_handler_filter {
     $options = parent::option_definition();
     $options['operator'] = array('default' => 'is');
     $options['type'] = array('default' => 'textfield');
+
     return $options;
   }
 
@@ -116,6 +117,7 @@ class location_handler_filter_location_province extends views_handler_filter {
       $country = variable_get('location_default_country', 'us');
     }
     $this->location_country = $country;
+
     return $country;
   }
 
diff --git a/handlers/location_handler_sort_location_country.inc b/handlers/location_handler_sort_location_country.inc
index cb5ae48..ff27acd 100644
--- a/handlers/location_handler_sort_location_country.inc
+++ b/handlers/location_handler_sort_location_country.inc
@@ -5,6 +5,7 @@ class location_handler_sort_location_country extends views_handler_sort {
   function option_definition() {
     $options = parent::option_definition();
     $options['country_sort'] = array('default' => 'name');
+
     return $options;
   }
 
diff --git a/handlers/location_handler_sort_location_distance.inc b/handlers/location_handler_sort_location_distance.inc
index 34e2ffd..620b502 100644
--- a/handlers/location_handler_sort_location_distance.inc
+++ b/handlers/location_handler_sort_location_distance.inc
@@ -4,7 +4,6 @@
  * @file
  * Coordinates sort handler.
  */
-
 class location_handler_sort_location_distance extends views_handler_sort {
 
   function option_definition() {
@@ -18,6 +17,7 @@ class location_handler_sort_location_distance extends views_handler_sort {
     $options['nid_arg'] = array('default' => '');
     $options['nid_loc_field'] = array('default' => 'node');
     $options['uid_arg'] = array('default' => '');
+
     return $options;
   }
 
@@ -40,7 +40,9 @@ class location_handler_sort_location_distance extends views_handler_sort {
         'nid_arg' => t("Node's Latitude / Longitude from views nid argument"),
         'uid_arg' => t("User's Latitude / Longitude from views uid argument"),
       ),
-      '#description' => t("This will be the way the latitude/longitude of origin is determined. When using the user's latitude / longitude, if a user has multiple locations the first will be used."),
+      '#description' => t(
+        "This will be the way the latitude/longitude of origin is determined. When using the user's latitude / longitude, if a user has multiple locations the first will be used."
+      ),
       '#default_value' => $this->options['origin'],
     );
     $form['latitude'] = array(
@@ -82,7 +84,9 @@ class location_handler_sort_location_distance extends views_handler_sort {
       '#default_value' => $this->options['php_code'],
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('php')),
-      '#description' => t("Enter PHP code that returns a latitude/longitude.  Do not use &lt;?php ?&gt;. You must return only an array with float values set for the 'latitude' and 'longitude' keys."),
+      '#description' => t(
+        "Enter PHP code that returns a latitude/longitude.  Do not use &lt;?php ?&gt;. You must return only an array with float values set for the 'latitude' and 'longitude' keys."
+      ),
     );
 
     list($nid_argument_options, $uid_argument_options) = location_views_proximity_get_argument_options($this->view);
@@ -93,7 +97,11 @@ class location_handler_sort_location_distance extends views_handler_sort {
       '#title' => t('Node ID argument to use'),
       '#options' => $nid_argument_options,
       '#default_value' => $this->options['nid_arg'],
-      '#description' => empty($nid_argument_options) ? t("Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID. You must have added arguments to the view to use this option.") : t("Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID."),
+      '#description' => empty($nid_argument_options) ? t(
+          "Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID. You must have added arguments to the view to use this option."
+        ) : t(
+          "Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID."
+        ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('nid_arg')),
     );
@@ -102,7 +110,9 @@ class location_handler_sort_location_distance extends views_handler_sort {
       '#title' => t('Location to use'),
       '#options' => $nid_loc_field_options,
       '#default_value' => $this->options['nid_loc_field'],
-      '#description' => t("Select which of the node's locations to use as the origin.  Either the node locations or a CCK location field.  If the location supports multiple entries the first one will be used."),
+      '#description' => t(
+        "Select which of the node's locations to use as the origin.  Either the node locations or a CCK location field.  If the location supports multiple entries the first one will be used."
+      ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('nid_arg')),
     );
@@ -111,7 +121,11 @@ class location_handler_sort_location_distance extends views_handler_sort {
       '#title' => t('User ID argument to use'),
       '#options' => $uid_argument_options,
       '#default_value' => $this->options['uid_arg'],
-      '#description' => empty($uid_argument_options) ? t("Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID. You must have added arguments to the view to use this option.") : t("Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID."),
+      '#description' => empty($uid_argument_options) ? t(
+          "Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID. You must have added arguments to the view to use this option."
+        ) : t(
+          "Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID."
+        ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('uid_arg')),
     );
@@ -147,7 +161,12 @@ class location_handler_sort_location_distance extends views_handler_sort {
       // This is done exactly the same as the field version.
       // Views is ok with us redefining the formula for a field.
       // If ANYTHING differs in the configuration, we will use a new alias.
-      $this->query->add_orderby(NULL, earth_distance_sql($coordinates['longitude'], $coordinates['latitude'], $this->table_alias), $this->options['order'], $alias);
+      $this->query->add_orderby(
+        NULL,
+        earth_distance_sql($coordinates['longitude'], $coordinates['latitude'], $this->table_alias),
+        $this->options['order'],
+        $alias
+      );
     }
   }
 }
diff --git a/handlers/location_views_handler_field_coordinates.inc b/handlers/location_views_handler_field_coordinates.inc
index 83243b0..9a973e7 100644
--- a/handlers/location_views_handler_field_coordinates.inc
+++ b/handlers/location_views_handler_field_coordinates.inc
@@ -4,7 +4,6 @@
  * @file
  * Coordinates field handler.
  */
-
 class location_views_handler_field_coordinates extends location_views_handler_field_latitude {
 
   function construct() {
@@ -14,7 +13,10 @@ class location_views_handler_field_coordinates extends location_views_handler_fi
 
   function render($values) {
     if ($this->options['style'] == 'dms') {
-      return theme('location_latitude_dms', array('latitude' => $values->{$this->field_alias})) . ', ' . theme('location_longitude_dms', array('longitude' => $values->{$this->aliases['longitude']}));
+      return theme('location_latitude_dms', array('latitude' => $values->{$this->field_alias})) . ', ' . theme(
+        'location_longitude_dms',
+        array('longitude' => $values->{$this->aliases['longitude']})
+      );
     }
     else {
       return check_plain($values->{$this->field_alias}) . ', ' . check_plain($values->{$this->aliases['longitude']});
diff --git a/handlers/location_views_handler_field_latitude.inc b/handlers/location_views_handler_field_latitude.inc
index caf6514..b85f368 100644
--- a/handlers/location_views_handler_field_latitude.inc
+++ b/handlers/location_views_handler_field_latitude.inc
@@ -4,12 +4,12 @@
  * @file
  * Latitude field handler.
  */
-
 class location_views_handler_field_latitude extends views_handler_field {
 
   function option_definition() {
     $options = parent::option_definition();
     $options['style'] = array('default' => 'dms');
+
     return $options;
   }
 
diff --git a/handlers/location_views_handler_field_longitude.inc b/handlers/location_views_handler_field_longitude.inc
index 5e9400a..678941a 100644
--- a/handlers/location_views_handler_field_longitude.inc
+++ b/handlers/location_views_handler_field_longitude.inc
@@ -4,13 +4,13 @@
  * @file
  * Longitude field handler.
  */
-
 class location_views_handler_field_longitude extends location_views_handler_field_latitude {
 
   function render($values) {
     if ($this->options['style'] == 'dms') {
       return theme('location_longitude_dms', array('longitude' => $values->{$this->field_alias}));
     }
+
     return parent::render($values);
   }
 }
diff --git a/handlers/location_views_handler_filter_proximity.inc b/handlers/location_views_handler_filter_proximity.inc
index fec18ab..85517ac 100644
--- a/handlers/location_views_handler_filter_proximity.inc
+++ b/handlers/location_views_handler_filter_proximity.inc
@@ -68,7 +68,9 @@ class location_views_handler_filter_proximity extends views_handler_filter {
       '#type' => 'checkbox',
       '#title' => t("Allow choice of user location"),
       '#default_value' => $this->options['expose']['user_location_choose'],
-      '#description' => t("If checked and using a user location origin, the user will be able to choose which of their locations to use.  Otherwise their first location will be used."),
+      '#description' => t(
+        "If checked and using a user location origin, the user will be able to choose which of their locations to use.  Otherwise their first location will be used."
+      ),
     );
   }
 
@@ -86,7 +88,9 @@ class location_views_handler_filter_proximity extends views_handler_filter {
         'nid_arg' => t("Node's Latitude / Longitude from views nid argument"),
         'uid_arg' => t("User's Latitude / Longitude from views uid argument"),
       ),
-      '#description' => t('This will be the way the latitude/longitude of origin is determined.  If this filter is exposed, this will determine the default values. NOTE: The PHP code, nid argument and uid argument options will not be available when the filter is exposed and the use of map is only available when the filter is exposed.  To use the visitor\'s IP address, you must have a supported geolocation module installed.'),
+      '#description' => t(
+        'This will be the way the latitude/longitude of origin is determined.  If this filter is exposed, this will determine the default values. NOTE: The PHP code, nid argument and uid argument options will not be available when the filter is exposed and the use of map is only available when the filter is exposed.  To use the visitor\'s IP address, you must have a supported geolocation module installed.'
+      ),
       '#default_value' => $this->options['origin'] ? $this->options['origin'] : 'user',
     );
     if (module_exists('gmap')) {
@@ -165,7 +169,9 @@ class location_views_handler_filter_proximity extends views_handler_filter {
       '#default_value' => $this->value['php_code'],
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('php')),
-      '#description' => t("Enter PHP code that returns a latitude/longitude.  Do not use &lt;?php ?&gt;. You must return only an array with float values set for the 'latitude' and 'longitude' keys."),
+      '#description' => t(
+        "Enter PHP code that returns a latitude/longitude.  Do not use &lt;?php ?&gt;. You must return only an array with float values set for the 'latitude' and 'longitude' keys."
+      ),
       '#weight' => 5,
     );
 
@@ -177,7 +183,11 @@ class location_views_handler_filter_proximity extends views_handler_filter {
       '#title' => t('Node ID argument to use'),
       '#options' => $nid_argument_options,
       '#default_value' => $this->value['nid_arg'],
-      '#description' => empty($nid_argument_options) ? t("Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID. You must have added arguments to the view to use this option.") : t("Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID."),
+      '#description' => empty($nid_argument_options) ? t(
+          "Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID. You must have added arguments to the view to use this option."
+        ) : t(
+          "Select which of the view's arguments to use as the node ID.  The latitude / longitude of the first location of that node will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID."
+        ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('nid_arg')),
       '#weight' => 6,
@@ -187,7 +197,9 @@ class location_views_handler_filter_proximity extends views_handler_filter {
       '#title' => t('Location to use'),
       '#options' => $nid_loc_field_options,
       '#default_value' => $this->value['nid_loc_field'],
-      '#description' => t("Select which of the node's locations to use as the origin.  Either the node locations or a CCK location field.  If the location supports multiple entries the first one will be used."),
+      '#description' => t(
+        "Select which of the node's locations to use as the origin.  Either the node locations or a CCK location field.  If the location supports multiple entries the first one will be used."
+      ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('nid_arg')),
       '#weight' => 7,
@@ -197,7 +209,11 @@ class location_views_handler_filter_proximity extends views_handler_filter {
       '#title' => t('User ID argument to use'),
       '#options' => $uid_argument_options,
       '#default_value' => $this->value['uid_arg'],
-      '#description' => empty($uid_argument_options) ? t("Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID. You must have added arguments to the view to use this option.") : t("Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID."),
+      '#description' => empty($uid_argument_options) ? t(
+          "Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID. You must have added arguments to the view to use this option."
+        ) : t(
+          "Select which of the view's arguments to use as the user ID.  The latitude / longitude of the first location of that user will be used as the origin. Use the 'Global: Null' argument if you don't want to also restrict results to that user ID."
+        ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('edit-options-origin' => array('uid_arg')),
       '#weight' => 8,
@@ -243,10 +259,14 @@ class location_views_handler_filter_proximity extends views_handler_filter {
       }
       else {
         $form[$key]['proximity_map'] = array(
-          '#markup' => gmap_set_location($this->options['expose']['gmap_macro'], $form[$key], array(
-            'latitude' => 'latitude',
-            'longitude' => 'longitude'
-          )),
+          '#markup' => gmap_set_location(
+            $this->options['expose']['gmap_macro'],
+            $form[$key],
+            array(
+              'latitude' => 'latitude',
+              'longitude' => 'longitude'
+            )
+          ),
           '#weight' => 0,
         );
       }
@@ -323,7 +343,10 @@ class location_views_handler_filter_proximity extends views_handler_filter {
     $lat = $coordinates['latitude'];
     $lon = $coordinates['longitude'];
 
-    $distance_meters = _location_convert_distance_to_meters($this->value['search_distance'], $this->value['search_units']);
+    $distance_meters = _location_convert_distance_to_meters(
+      $this->value['search_distance'],
+      $this->value['search_units']
+    );
     $latrange = earth_latitude_range($lon, $lat, $distance_meters);
     $lonrange = earth_longitude_range($lon, $lat, $distance_meters);
 
@@ -335,16 +358,24 @@ class location_views_handler_filter_proximity extends views_handler_filter {
     else {
       $where = "$this->table_alias.latitude > :minlat AND $this->table_alias.latitude < :maxlat AND $this->table_alias.longitude > :minlon AND $this->table_alias.longitude < :maxlon";
     }
-    $this->query->add_where_expression($this->options['group'], $where, array(
-      ':minlat' => $latrange[0],
-      ':maxlat' => $latrange[1],
-      ':minlon' => $lonrange[0],
-      ':maxlon' => $lonrange[1]
-    ));
+    $this->query->add_where_expression(
+      $this->options['group'],
+      $where,
+      array(
+        ':minlat' => $latrange[0],
+        ':maxlat' => $latrange[1],
+        ':minlon' => $lonrange[0],
+        ':maxlon' => $lonrange[1]
+      )
+    );
 
     if ($this->operator == 'dist') {
       // Add radius check.
-      $this->query->add_where_expression($this->options['group'], earth_distance_sql($lon, $lat, $this->table_alias) . ' < :distance', array(':distance' => $distance_meters));
+      $this->query->add_where_expression(
+        $this->options['group'],
+        earth_distance_sql($lon, $lat, $this->table_alias) . ' < :distance',
+        array(':distance' => $distance_meters)
+      );
     }
   }
 }
diff --git a/help/location.help.ini b/help/location.help.ini
index 2bd8e56..0d753b8 100644
--- a/help/location.help.ini
+++ b/help/location.help.ini
@@ -1,4 +1,3 @@
-
 [testing]
 title = "Testing Procedure"
 file = test_procedure
diff --git a/location.admin.inc b/location.admin.inc
index 19d3087..e375c76 100644
--- a/location.admin.inc
+++ b/location.admin.inc
@@ -25,7 +25,9 @@ function location_admin_settings($form, &$form_state) {
     '#title' => t('Default country selection'),
     '#default_value' => variable_get('location_default_country', 'us'),
     '#options' => $iso_list_sorted,
-    '#description' => t('This will be the country that is automatically selected when a location form is served for a new location.')
+    '#description' => t(
+      'This will be the country that is automatically selected when a location form is served for a new location.'
+    )
   );
   $form['location_display_location'] = array(
     '#type' => 'radios',
@@ -35,7 +37,9 @@ function location_admin_settings($form, &$form_state) {
       0 => t('Disable the display of locations.'),
       1 => t('Enable the display of locations.')
     ),
-    '#description' => t('If you are interested in turning off locations and having a custom theme control their display, you may want to disable the display of locations so your theme can take that function.')
+    '#description' => t(
+      'If you are interested in turning off locations and having a custom theme control their display, you may want to disable the display of locations so your theme can take that function.'
+    )
   );
 
   $form['location_use_province_abbreviation'] = array(
@@ -52,11 +56,14 @@ function location_admin_settings($form, &$form_state) {
     '#type' => 'checkbox',
     '#title' => t('Use a Google Map to set latitude and longitude '),
     '#default_value' => variable_get('location_usegmap', FALSE),
-    '#description' => t('If the gmap.module is installed and <a href="@enabled">enabled</a>, and this setting is also turned on, users that are allowed to manually enter latitude/longitude coordinates will be able to do so with an interactive Google Map.  You should also make sure you have entered a <a href="@google_maps_api_key">Google Maps API key</a> into your <a href="@gmap_module_settings">gmap module settings</a>.', array(
-      '@enabled' => url('admin/build/modules'),
-      '@google_maps_api_key' => 'http://www.google.com/apis/maps',
-      '@gmap_module_settings' => url('admin/config/content/gmap')
-    )),
+    '#description' => t(
+      'If the gmap.module is installed and <a href="@enabled">enabled</a>, and this setting is also turned on, users that are allowed to manually enter latitude/longitude coordinates will be able to do so with an interactive Google Map.  You should also make sure you have entered a <a href="@google_maps_api_key">Google Maps API key</a> into your <a href="@gmap_module_settings">gmap module settings</a>.',
+      array(
+        '@enabled' => url('admin/build/modules'),
+        '@google_maps_api_key' => 'http://www.google.com/apis/maps',
+        '@gmap_module_settings' => url('admin/config/content/gmap')
+      )
+    ),
 // @@@ megapatch This is an idea, but I'd opt more for a warning here...
 //    '#disabled'       => !module_exists('gmap'),
   );
@@ -67,14 +74,18 @@ function location_admin_settings($form, &$form_state) {
     '#size' => 50,
     '#maxlength' => 500,
     '#default_value' => variable_get('location_locpick_macro', '[gmap]'),
-    '#description' => t('If you would like to change the macro used to generate the location chooser map, you can do so here. Note: Behaviors <em>locpick</em> and <em>collapsehack</em> are forced to be enabled and cannot be changed.'),
+    '#description' => t(
+      'If you would like to change the macro used to generate the location chooser map, you can do so here. Note: Behaviors <em>locpick</em> and <em>collapsehack</em> are forced to be enabled and cannot be changed.'
+    ),
   );
 
   $form['location_jit_geocoding'] = array(
     '#type' => 'checkbox',
     '#title' => t('Enable JIT geocoding'),
     '#default_value' => variable_get('location_jit_geocoding', FALSE),
-    '#description' => t('If you are going to be importing locations in bulk directly into the database, you may wish to enable JIT geocoding and load the locations with source set to 4 (LOCATION_LATLON_JIT_GEOCODING). The system will automatically geocode locations as they are loaded.'),
+    '#description' => t(
+      'If you are going to be importing locations in bulk directly into the database, you may wish to enable JIT geocoding and load the locations with source set to 4 (LOCATION_LATLON_JIT_GEOCODING). The system will automatically geocode locations as they are loaded.'
+    ),
   );
 
   $form['maplink_external'] = array(
@@ -95,7 +106,9 @@ function location_admin_settings($form, &$form_state) {
       'rel="external"' => 'rel="external"',
     ),
     '#default_value' => variable_get('location_maplink_external_method', 'target="_blank"'),
-    '#description' => t('If you have selected to open map in a new window this controls the method used to open in a new window.  target="_blank" will just work but is not XTHML Strict compliant.  rel="external" is XHTML Strict compliant but will not open in a new window unless you add some jQuery to your site to add the target attribute. If you are unsure leave set to target="_blank"'),
+    '#description' => t(
+      'If you have selected to open map in a new window this controls the method used to open in a new window.  target="_blank" will just work but is not XTHML Strict compliant.  rel="external" is XHTML Strict compliant but will not open in a new window unless you add some jQuery to your site to add the target attribute. If you are unsure leave set to target="_blank"'
+    ),
   );
 
   return system_settings_form($form);
@@ -132,11 +145,17 @@ function location_map_link_options_form($form, &$form_state) {
 
     // Default providers will be taken from the country specific default providers
     // function if it exists, otherwise it will use the global function.
-    $checked = variable_get('location_map_link_' . $country_iso, function_exists($default_provider_function) ? $default_provider_function() : location_map_link_default_providers());
+    $checked = variable_get(
+      'location_map_link_' . $country_iso,
+      function_exists($default_provider_function) ? $default_provider_function() : location_map_link_default_providers()
+    );
 
     // Merge the global providers with country specific ones so that countries
     // can add to or override the defaults.
-    $providers = function_exists($provider_function) ? array_merge(location_map_link_providers(), $provider_function()) : location_map_link_providers();
+    $providers = function_exists($provider_function) ? array_merge(
+      location_map_link_providers(),
+      $provider_function()
+    ) : location_map_link_providers();
     foreach ($providers as $name => $details) {
       $mapping_options[$name] = '<a href="' . $details['url'] . '">' . $details['name'] . '</a> (<a href="' . $details['tos'] . '">Terms of Use</a>)';
     }
@@ -159,6 +178,7 @@ function location_map_link_options_form($form, &$form_state) {
 
   $form = system_settings_form($form);
   $form['#theme'] = 'location_map_link_options';
+
   return $form;
 }
 
@@ -170,7 +190,10 @@ function location_geocoding_options_form($form, &$form_state) {
     '#title' => t('Google Maps geocoding minimum accuracy'),
     '#options' => location_google_geocode_accuracy_codes(),
     '#default_value' => variable_get('location_geocode_google_minimum_accuracy', '3'),
-    '#description' => t('The Google Maps geocoding API returns results with a given accuracy. Any responses below this minimum accuracy will be ignored. See a !accuracy_values_link.', array('!accuracy_values_link' => '<a href="http://code.google.com/apis/maps/documentation/reference.html#GGeoAddressAccuracy">description of these values</a>'))
+    '#description' => t(
+      'The Google Maps geocoding API returns results with a given accuracy. Any responses below this minimum accuracy will be ignored. See a !accuracy_values_link.',
+      array('!accuracy_values_link' => '<a href="http://code.google.com/apis/maps/documentation/reference.html#GGeoAddressAccuracy">description of these values</a>')
+    )
   );
   $form['countries'] = array();
 
@@ -294,7 +317,10 @@ function location_geocoding_options_form_submit($form, &$form_state) {
     }
   }
 
-  variable_set('location_geocode_google_minimum_accuracy', $form_state['values']['location_geocode_google_minimum_accuracy']);
+  variable_set(
+    'location_geocode_google_minimum_accuracy',
+    $form_state['values']['location_geocode_google_minimum_accuracy']
+  );
   variable_set('location_general_geocoders_in_use', $general_geocoders_in_use);
 }
 
@@ -319,6 +345,7 @@ function theme_location_map_link_options($variables) {
   }
   $output = theme('table', array('header' => $header, 'rows' => $rows));
   $output .= drupal_render_children($form);
+
   return $output;
 }
 
@@ -347,6 +374,7 @@ function theme_location_geocoding_options($variables) {
   }
   $output .= theme('table', array('header' => $header, 'rows' => $rows));
   $output .= drupal_render_children($form);
+
   return $output;
 }
 
@@ -357,13 +385,17 @@ function location_util_form($form, &$form_State) {
   $form['province_clear'] = array(
     '#type' => 'fieldset',
     '#title' => t('Clear province cache'),
-    '#description' => t('If you have modified location.xx.inc files, you will need to clear the province cache to get Location to recognize the modifications.'),
+    '#description' => t(
+      'If you have modified location.xx.inc files, you will need to clear the province cache to get Location to recognize the modifications.'
+    ),
   );
 
   $form['supported_countries_clear'] = array(
     '#type' => 'fieldset',
     '#title' => t('Clear supported country list'),
-    '#description' => t('If you have added support for a new country, you will need to clear the supported country list to get Location to recognize the modifications.'),
+    '#description' => t(
+      'If you have added support for a new country, you will need to clear the supported country list to get Location to recognize the modifications.'
+    ),
   );
 
   $form['actions'] = array(
@@ -379,6 +411,7 @@ function location_util_form($form, &$form_State) {
     '#value' => t('Clear supported country list'),
     '#submit' => array('location_util_form_clear_supported_countries_submit'),
   );
+
   return $form;
 }
 
diff --git a/location.georss.inc b/location.georss.inc
index 3d3f762..3ca4cae 100644
--- a/location.georss.inc
+++ b/location.georss.inc
@@ -80,5 +80,6 @@ function _location_rss_item($location, $mode = 'simple') {
         break;
     }
   }
+
   return $ret;
 }
diff --git a/location.inc b/location.inc
index fc39cd8..8024d8c 100644
--- a/location.inc
+++ b/location.inc
@@ -46,10 +46,16 @@ function location_map_link($location = array(), $link_text = 'See map: ') {
   $providers_func = 'location_map_link_' . $location['country'] . '_providers';
   // Merge the global providers with country specific ones so that countries
   // can add to or override the defaults.
-  $providers = function_exists($providers_func) ? array_merge(location_map_link_providers(), $providers_func()) : location_map_link_providers();
+  $providers = function_exists($providers_func) ? array_merge(
+    location_map_link_providers(),
+    $providers_func()
+  ) : location_map_link_providers();
   // Default providers will be taken from the country specific default providers
   // function if it exists, otherwise it will use the global function.
-  $selected_providers = variable_get('location_map_link_' . $location['country'], function_exists($default_func) ? $default_func() : location_map_link_default_providers());
+  $selected_providers = variable_get(
+    'location_map_link_' . $location['country'],
+    function_exists($default_func) ? $default_func() : location_map_link_default_providers()
+  );
 
   $links = array();
   foreach ($selected_providers as $mapper) {
@@ -58,7 +64,10 @@ function location_map_link($location = array(), $link_text = 'See map: ') {
     $link_func = function_exists($link_func) ? $link_func : 'location_map_link_' . $mapper;
     if (function_exists($link_func)) {
       if ($link = $link_func($location)) {
-        $links[] = '<a href="' . $link . '"' . (variable_get('location_maplink_external', 0) ? ' ' . variable_get('location_maplink_external_method', 'target="_blank"') : '') . '>' . $providers[$mapper]['name'] . '</a>';
+        $links[] = '<a href="' . $link . '"' . (variable_get('location_maplink_external', 0) ? ' ' . variable_get(
+              'location_maplink_external_method',
+              'target="_blank"'
+            ) : '') . '>' . $providers[$mapper]['name'] . '</a>';
       }
     }
   }
@@ -169,7 +178,10 @@ function location_map_link_google($location = array()) {
 function location_get_postalcode_data($location = array()) {
   $location['country'] = isset($location['country']) ? trim($location['country']) : NULL;
   $location['postal_code'] = isset($location['postal_code']) ? trim($location['postal_code']) : NULL;
-  if (is_null($location['postal_code']) || is_null($location['country']) || empty($location['country']) || empty($location['postal_code']) || $location['postal_code'] == 'xx') {
+  if (is_null($location['postal_code']) || is_null(
+      $location['country']
+    ) || empty($location['country']) || empty($location['postal_code']) || $location['postal_code'] == 'xx'
+  ) {
     return NULL;
   }
   location_load_country($location['country']);
@@ -220,6 +232,7 @@ function location_distance_between($latlon_a = array(), $latlon_b = array(), $di
   //$conversion_factor = ($distance_unit == 'km') ? 1000.0 : 1609.347;
 
   $meters = earth_distance($latlon_a['lon'], $latlon_a['lat'], $latlon_b['lon'], $latlon_b['lat']);
+
   return array(
     'scalar' => round($meters / (($distance_unit == 'km') ? 1000.0 : 1609.347), 1),
     'distance_unit' => $distance_unit
@@ -316,6 +329,7 @@ function _location_convert_distance_to_meters($distance, $distance_unit = 'km')
 
   // Convert distance to meters
   $retval = round(floatval($distance) * (($distance_unit == 'km') ? 1000.0 : 1609.347), 2);
+
   return $retval;
 }
 
@@ -396,14 +410,17 @@ function location_latlon_rough_default($location = array()) {
       // and store results in zipcodes table for next lookups being internally handled
       // (yeah this is missing city/state info a.t.m., but is way better than nothing!)
       db_insert('zipcodes')
-        ->fields(array(
-          'latitude' => $newlatlong['lat'],
-          'longitude' => $newlatlong['lon'],
-          'country' => $location['country'],
-          'zip' => $location['postal_code'],
-        ))
+        ->fields(
+          array(
+            'latitude' => $newlatlong['lat'],
+            'longitude' => $newlatlong['lon'],
+            'country' => $location['country'],
+            'zip' => $location['postal_code'],
+          )
+        )
         ->execute();
     }
+
     return $newlatlong;
   }
   else {
@@ -495,6 +512,7 @@ function location_latlon_exact($location = array()) {
       return NULL;
     }
   }
+
   return NULL;
 }
 
@@ -536,6 +554,7 @@ function _location_supported_countries() {
     }
     cache_set('location:supported-countries', $supported_countries, 'cache_location');
   }
+
   return $supported_countries;
 }
 
@@ -554,6 +573,7 @@ function location_get_provinces($country = 'us') {
   }
   if ($cache = cache_get("provinces:$country:$lang_code", 'cache_location')) {
     $provinces[$country] = $cache->data;
+
     return $provinces[$country];
   }
   location_load_country($country);
@@ -561,8 +581,10 @@ function location_get_provinces($country = 'us') {
   if (function_exists($func)) {
     $provinces[$country] = $func();
     cache_set("provinces:$country:$lang_code", $provinces[$country], 'cache_location');
+
     return $provinces[$country];
   }
+
   return array();
 }
 
@@ -621,6 +643,7 @@ function location_province_code($country = 'us', $province = 'xx') {
       }
     }
   }
+
   return '';
 }
 
@@ -633,10 +656,12 @@ function location_standardize_country_code(&$country) {
   // @@@ Double check the validity of this validity check. ;)
   if (!ctype_alpha($country) || strlen($country) != 2) {
     $country = 'xx';
+
     return FALSE;
   }
   else {
     $country = strtolower($country);
+
     return TRUE;
   }
 }
@@ -658,8 +683,10 @@ function location_load_country($country) {
   $file = DRUPAL_ROOT . '/' . drupal_get_path('module', 'location') . '/supported/location.' . $country . '.inc';
   if (file_exists($file)) {
     include_once($file);
+
     return TRUE;
   }
+
   return FALSE;
 }
 
@@ -731,7 +758,11 @@ function location_get_general_geocoder_list() {
   $list = & drupal_static(__FUNCTION__, array());
 
   if (!count($list)) {
-    $files = file_scan_directory(drupal_get_path('module', 'location') . '/geocoding', '/\.inc$/', array('nomask' => '/(\.\.?|CVS|\.svn)$/'));
+    $files = file_scan_directory(
+      drupal_get_path('module', 'location') . '/geocoding',
+      '/\.inc$/',
+      array('nomask' => '/(\.\.?|CVS|\.svn)$/')
+    );
     foreach ($files as $full_path_name => $fileinfo) {
       $list[] = $fileinfo->name;
     }
@@ -762,5 +793,6 @@ function location_get_iso3166_list($upper = FALSE) {
     // to convert.
     $countries = array_change_key_case(country_get_list(), CASE_LOWER);
   }
+
   return $countries;
 }
diff --git a/location.install b/location.install
index 18d4b62..9557a02 100644
--- a/location.install
+++ b/location.install
@@ -250,33 +250,39 @@ function location_schema() {
         'type' => 'varchar',
         'length' => 255,
         'not null' => TRUE,
-        'default' => ''),
+        'default' => ''
+      ),
       'data' => array(
         'description' => 'A collection of data to cache.',
         'type' => 'blob',
         'not null' => FALSE,
-        'size' => 'big'),
+        'size' => 'big'
+      ),
       'expire' => array(
         'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
         'type' => 'int',
         'not null' => TRUE,
-        'default' => 0),
+        'default' => 0
+      ),
       'created' => array(
         'description' => 'A Unix timestamp indicating when the cache entry was created.',
         'type' => 'int',
         'not null' => TRUE,
-        'default' => 0),
+        'default' => 0
+      ),
       'headers' => array(
         'description' => 'Any custom HTTP headers to be added to cached data.',
         'type' => 'text',
-        'not null' => FALSE),
+        'not null' => FALSE
+      ),
       'serialized' => array(
         'description' => 'A flag to indicate whether content is serialized (1) or not (0).',
         'type' => 'int',
         'size' => 'small',
         'not null' => TRUE,
-        'default' => 0)
-      ),
+        'default' => 0
+      )
+    ),
     'indexes' => array('expire' => array('expire')),
     'primary key' => array('cid'),
   );
@@ -323,6 +329,7 @@ function location_update_2() {
     $configured_countries['us'] = 'us';
     variable_set('location_configured_countries', $configured_countries);
   }
+
   return array();
 }
 
@@ -332,22 +339,29 @@ function location_update_2() {
  * name on postgresql.
  */
 function location_update_3() {
-  db_change_field('location', 'oid', 'eid', array(
-    'type' => 'int',
-    'unsigned' => TRUE,
-    'not null' => TRUE,
-    'default' => 0,
-  ));
+  db_change_field(
+    'location',
+    'oid',
+    'eid',
+    array(
+      'type' => 'int',
+      'unsigned' => TRUE,
+      'not null' => TRUE,
+      'default' => 0,
+    )
+  );
 
   if (module_exists('views')) {
     views_invalidate_cache();
   }
-  
-  return t("The schema for location module has been updated.  The update is such that you may want to re-resave any views you have that may include locations.");
+
+  return t(
+    "The schema for location module has been updated.  The update is such that you may want to re-resave any views you have that may include locations."
+  );
 }
 
 /***************************************************************
-  PostgreSQL must be supported in all updates after this comment
+ * PostgreSQL must be supported in all updates after this comment
  ***************************************************************/
 
 /**
@@ -355,21 +369,27 @@ function location_update_3() {
  * Add "lid" as the new location key.
  */
 function location_update_4() {
-  db_add_field('location', 'lid', array(
-    'type' => 'serial',
-    'unsigned' => TRUE,
-    'not null' => TRUE,
-    'description' => 'Primary Key: Unique location ID.',
-  ));
+  db_add_field(
+    'location',
+    'lid',
+    array(
+      'type' => 'serial',
+      'unsigned' => TRUE,
+      'not null' => TRUE,
+      'description' => 'Primary Key: Unique location ID.',
+    )
+  );
 
   $result = db_query("SELECT eid, type FROM {location}");
   $next_id = 0;
   foreach ($result as $row) {
     $next_id++;
     db_update('location')
-      ->fields(array(
-        'lid' => $next_id,
-      ))
+      ->fields(
+        array(
+          'lid' => $next_id,
+        )
+      )
       ->condition('eid', $row->eid)
       ->condition('type', $row->type)
       ->execute();
@@ -379,27 +399,35 @@ function location_update_4() {
   db_add_primary_key('location', array('lid'));
 
   db_insert('sequences')
-    ->fields(array(
-      'name' => '{location}_lid',
-      'id' => $next_id,
-    ))
+    ->fields(
+      array(
+        'name' => '{location}_lid',
+        'id' => $next_id,
+      )
+    )
     ->execute();
 
-  db_add_field('location', 'is_primary', array(
-    'description' => 'Is this the primary location of an object? (unused, civicrm legacy field?).',
-    'type' => 'int',
-    'size' => 'tiny',
-    'default' => 0,
-    'not null' => TRUE,
-  ));
+  db_add_field(
+    'location',
+    'is_primary',
+    array(
+      'description' => 'Is this the primary location of an object? (unused, civicrm legacy field?).',
+      'type' => 'int',
+      'size' => 'tiny',
+      'default' => 0,
+      'not null' => TRUE,
+    )
+  );
 
   db_update('location')
-    ->fields(array(
-      'is_primary' => 1,
-    ))
+    ->fields(
+      array(
+        'is_primary' => 1,
+      )
+    )
     ->condition('type', 'user')
     ->execute();
-      
+
   foreach (node_type_get_types() as $type) {
     $new_setting = variable_get('location_' . $type->type, 0) ? 1 : 0;
     variable_del('location_' . $type->type);
@@ -424,9 +452,11 @@ function location_update_5() {
  */
 function location_update_6() {
   db_update('location')
-    ->fields(array(
-      'country' => 'se',
-    ))
+    ->fields(
+      array(
+        'country' => 'se',
+      )
+    )
     ->condition('country', 'sw')
     ->execute();
 }
@@ -445,9 +475,11 @@ function location_update_7() {
     $value_decoded = unserialize($row->value);
     if (!in_array($value_decoded, $services)) {
       db_update('variable')
-        ->fields(array(
-          'value' => serialize($value_decoded . '|' . substr($row->name, 17)),
-        ))
+        ->fields(
+          array(
+            'value' => serialize($value_decoded . '|' . substr($row->name, 17)),
+          )
+        )
         ->condition('name', $row->name)
         ->execute();
     }
@@ -456,17 +488,21 @@ function location_update_7() {
     }
   }
 
-  $key = db_query("SELECT value FROM {variable} WHERE name REGEXP '^location_geocode_[a-z][a-z]_google_apikey$'")->fetchField();
+  $key = db_query(
+    "SELECT value FROM {variable} WHERE name REGEXP '^location_geocode_[a-z][a-z]_google_apikey$'"
+  )->fetchField();
 
   db_delete('variable')
     ->where("name REGEXP '^location_geocode_[a-z][a-z]_google_apikey$'")
     ->execute();
 
   db_insert('variable')
-    ->fields(array(
-      'name' => 'location_geocode_google_apikey',
-      'value' => $key,
-    ))
+    ->fields(
+      array(
+        'name' => 'location_geocode_google_apikey',
+        'value' => $key,
+      )
+    )
     ->execute();
 
   db_delete('cache')
@@ -643,30 +679,43 @@ function location_update_5301() {
   // This will let us do better cleanup sometime in the future.
   $data = array();
   $todelete = array();
-  foreach(array('name', 'street', 'additional', 'city', 'province', 'postal_code', 'country', 'phone', 'fax') as $field) {
+  foreach (array(
+             'name',
+             'street',
+             'additional',
+             'city',
+             'province',
+             'postal_code',
+             'country',
+             'phone',
+             'fax'
+           ) as $field) {
     $result = db_query("SELECT name, value FROM {variable} WHERE name > :name", array(':name' => "location_$field%"));
     foreach ($result as $row) {
-      $data[substr($row->name, strlen($field) + 10)][$field] = (string)(int)unserialize($row->value);
+      $data[substr($row->name, strlen($field) + 10)][$field] = (string) (int) unserialize($row->value);
       $todelete[] = $row->name;
     }
   }
   foreach ($data as $type => $value) {
     // We aren't going to trust that hook_locationapi is operational.
     // So, stick with some conservative defaults.
-    $value = array_merge(array(
-      'name' => '1',
-      'street' => '1',
-      // additional is left out of this list intentionally.
-      'city' => '0',
-      'province' => '0',
-      'postal_code' => '0',
-      'country' => '1',
-    ), $value);
+    $value = array_merge(
+      array(
+        'name' => '1',
+        'street' => '1',
+        // additional is left out of this list intentionally.
+        'city' => '0',
+        'province' => '0',
+        'postal_code' => '0',
+        'country' => '1',
+      ),
+      $value
+    );
     if (!isset($value['additional'])) {
       // Initialize additional to match street.
       $value['additional'] = $value['street'];
     }
-    variable_set('location_fields_'. $type, $value);
+    variable_set('location_fields_' . $type, $value);
   }
   foreach ($todelete as $key) {
     variable_del($key);
@@ -694,13 +743,17 @@ function location_update_5302() {
   // user, non node data intact. People doing an update after Aug 18 will already
   // have the genid column in place, so it can be safely skipped.
   if (!variable_get('location_update_5301_retrofit', FALSE)) {
-    db_add_field('location_instance', 'genid', array(
-      'description' => 'Generic reference key.',
-      'type' => 'varchar',
-      'length' => 255,
-      'not null' => TRUE,
-      'default' => '',
-    ));
+    db_add_field(
+      'location_instance',
+      'genid',
+      array(
+        'description' => 'Generic reference key.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      )
+    );
 
     db_add_index('location_instance', 'genid', array('genid'));
   }
@@ -715,9 +768,9 @@ function location_update_5303() {
   $result = db_query("SELECT name FROM {variable} WHERE name LIKE 'location_display_teaser_%'");
   foreach ($result as $row) {
     $type = substr($row->name, 24);
-    $types[$type]['teaser'] = variable_get('location_display_teaser_'. $type, TRUE);
-    $types[$type]['full'] = variable_get('location_display_full_'. $type, TRUE);
-    $types[$type]['weight'] = variable_get('location_display_weight_'. $type, 0);
+    $types[$type]['teaser'] = variable_get('location_display_teaser_' . $type, TRUE);
+    $types[$type]['full'] = variable_get('location_display_full_' . $type, TRUE);
+    $types[$type]['weight'] = variable_get('location_display_weight_' . $type, 0);
     // @@@ Combine location_suppress_country and country require settings to set this up?
     $types[$type]['hide'] = array();
   }
@@ -748,33 +801,39 @@ function location_update_6301() {
         'type' => 'varchar',
         'length' => 255,
         'not null' => TRUE,
-        'default' => ''),
+        'default' => ''
+      ),
       'data' => array(
         'description' => 'A collection of data to cache.',
         'type' => 'blob',
         'not null' => FALSE,
-        'size' => 'big'),
+        'size' => 'big'
+      ),
       'expire' => array(
         'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
         'type' => 'int',
         'not null' => TRUE,
-        'default' => 0),
+        'default' => 0
+      ),
       'created' => array(
         'description' => 'A Unix timestamp indicating when the cache entry was created.',
         'type' => 'int',
         'not null' => TRUE,
-        'default' => 0),
+        'default' => 0
+      ),
       'headers' => array(
         'description' => 'Any custom HTTP headers to be added to cached data.',
         'type' => 'text',
-        'not null' => FALSE),
+        'not null' => FALSE
+      ),
       'serialized' => array(
         'description' => 'A flag to indicate whether content is serialized (1) or not (0).',
         'type' => 'int',
         'size' => 'small',
         'not null' => TRUE,
-        'default' => 0)
-      ),
+        'default' => 0
+      )
+    ),
     'indexes' => array('expire' => array('expire')),
     'primary key' => array('cid'),
   );
@@ -787,19 +846,26 @@ function location_update_6301() {
   $has_rows = (bool) db_query_range('SELECT 1 FROM {location} WHERE lid = 0', 0, 1)->fetchField();
   if ($has_rows) {
     $lid = 1 + db_query('SELECT MAX(lid) FROM {location}')->fetchField();
-    $message = t('Note: A location with lid 0 was found in your database. It has been moved to lid %lid. You may wish to verify it manually, as lid 0 is usually a corrupt entry.', array('%lid' => $lid));
+    $message = t(
+      'Note: A location with lid 0 was found in your database. It has been moved to lid %lid. You may wish to verify it manually, as lid 0 is usually a corrupt entry.',
+      array('%lid' => $lid)
+    );
 
     db_update('location')
-      ->fields(array(
-        'lid' => $lid,
-      ))
+      ->fields(
+        array(
+          'lid' => $lid,
+        )
+      )
       ->condition('lid', 0)
       ->execute();
 
     db_update('location_instance')
-      ->fields(array(
-        'lid' => $lid,
-      ))
+      ->fields(
+        array(
+          'lid' => $lid,
+        )
+      )
       ->condition('lid', 0)
       ->execute();
   }
@@ -810,9 +876,13 @@ function location_update_6301() {
 
   // {location}.lid -- Becomes a serial.
   db_drop_primary_key('location');
-  db_change_field('location', 'lid', 'lid',
+  db_change_field(
+    'location',
+    'lid',
+    'lid',
     array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
-    array('primary key' => array('lid')));
+    array('primary key' => array('lid'))
+  );
 
   // (The rest of the changes to this table were moved to update 6302 due to a bug.)
 
@@ -832,44 +902,77 @@ function location_update_6301() {
 
   // Fill in nulls.
   db_update('location_instance')
-    ->fields(array(
-      'nid' => 0,
-    ))
+    ->fields(
+      array(
+        'nid' => 0,
+      )
+    )
     ->isNull('nid')
     ->execute();
 
   db_update('location_instance')
-    ->fields(array(
-      'vid' => 0,
-    ))
+    ->fields(
+      array(
+        'vid' => 0,
+      )
+    )
     ->isNull('vid')
     ->execute();
 
   db_update('location_instance')
-    ->fields(array(
-      'uid' => 0,
-    ))
+    ->fields(
+      array(
+        'uid' => 0,
+      )
+    )
     ->isNull('uid')
     ->execute();
 
   db_update('location_instance')
-    ->fields(array(
-      'genid' => 0,
-    ))
+    ->fields(
+      array(
+        'genid' => 0,
+      )
+    )
     ->isNull('genid')
     ->execute();
 
   // {location_instance}.nid
-  db_change_field('location_instance', 'nid', 'nid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_change_field(
+    'location_instance',
+    'nid',
+    'nid',
+    array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+  );
   // {location_instance}.vid
-  db_change_field('location_instance', 'vid', 'vid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_change_field(
+    'location_instance',
+    'vid',
+    'vid',
+    array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+  );
   // {location_instance}.uid
-  db_change_field('location_instance', 'uid', 'uid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_change_field(
+    'location_instance',
+    'uid',
+    'uid',
+    array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+  );
   // {location_instance}.genid
-  db_change_field('location_instance', 'genid', 'genid', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+  db_change_field(
+    'location_instance',
+    'genid',
+    'genid',
+    array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
+  );
 
   // {location_instance}.lid
-  db_change_field('location_instance', 'lid', 'lid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_change_field(
+    'location_instance',
+    'lid',
+    'lid',
+    array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+  );
 
   // Readd indexes.
   db_add_index('location_instance', 'nid', array('nid'));
@@ -885,7 +988,10 @@ function location_update_6301() {
   if ($message) {
     $message .= '<br /><br />';
   }
-  return $message . t('Note: Location.module update 6301 will generate several warnings/failures regarding indexes and primary keys if you are upgrading from one of the 6.x test releases. These warnings can be safely disregarded in this case.');
+
+  return $message . t(
+    'Note: Location.module update 6301 will generate several warnings/failures regarding indexes and primary keys if you are upgrading from one of the 6.x test releases. These warnings can be safely disregarded in this case.'
+  );
 }
 
 /**
@@ -899,57 +1005,92 @@ function location_update_6302() {
   // 6.x-3.0 pre-rc1 as well, but I didn't notice because I accidentally added
   // the not null when reformatting the schema.
   db_update('location')
-    ->fields(array(
-      'is_primary' => 0,
-    ))
+    ->fields(
+      array(
+        'is_primary' => 0,
+      )
+    )
     ->isNull('is_primary')
     ->execute();
-    
-  db_change_field('location', 'is_primary', 'is_primary', array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'not null' => TRUE));
+
+  db_change_field(
+    'location',
+    'is_primary',
+    'is_primary',
+    array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'not null' => TRUE)
+  );
 
   // Fix zipcode mismatches caused by the same problem.
 
   // There shouldn't be any rows like this, but it doesn't hurt to be sure.
   db_update('zipcodes')
-    ->fields(array(
-      'zip' => 0,
-    ))
+    ->fields(
+      array(
+        'zip' => 0,
+      )
+    )
     ->isNull('zip')
     ->execute();
 
   // Set not null.
-  db_change_field('zipcodes', 'zip', 'zip', array('type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => '0'));
+  db_change_field(
+    'zipcodes',
+    'zip',
+    'zip',
+    array('type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => '0')
+  );
 
   // Prepare latitude and longitude for the same.
   db_update('zipcodes')
-    ->fields(array(
-      'latitude' => 0.0,
-    ))
+    ->fields(
+      array(
+        'latitude' => 0.0,
+      )
+    )
     ->isNull('latitude')
     ->execute();
 
   db_update('zipcodes')
-    ->fields(array(
-      'longitude' => 0.0,
-    ))
+    ->fields(
+      array(
+        'longitude' => 0.0,
+      )
+    )
     ->isNull('longitude')
     ->execute();
 
   // Set not null.
-  db_change_field('zipcodes', 'latitude', 'latitude', array('type' => 'numeric', 'not null' => TRUE, 'default' => 0, 'precision' => 10, 'scale' => 6));
-  db_change_field('zipcodes', 'longitude', 'longitude', array('type' => 'numeric', 'not null' => TRUE, 'default' => 0, 'precision' => 10, 'scale' => 6));
+  db_change_field(
+    'zipcodes',
+    'latitude',
+    'latitude',
+    array('type' => 'numeric', 'not null' => TRUE, 'default' => 0, 'precision' => 10, 'scale' => 6)
+  );
+  db_change_field(
+    'zipcodes',
+    'longitude',
+    'longitude',
+    array('type' => 'numeric', 'not null' => TRUE, 'default' => 0, 'precision' => 10, 'scale' => 6)
+  );
 
   // Prepare country.
   update_sql("UPDATE {zipcodes} SET country = '' WHERE country IS NULL");
   db_update('zipcodes')
-    ->fields(array(
-      'country' => '',
-    ))
+    ->fields(
+      array(
+        'country' => '',
+      )
+    )
     ->isNull('country')
     ->execute();
 
   // Set not null.
-  db_change_field('zipcodes', 'country', 'country', array('type' => 'char', 'length' => 2, 'not null' => TRUE, 'default' => ''));
+  db_change_field(
+    'zipcodes',
+    'country',
+    'country',
+    array('type' => 'char', 'length' => 2, 'not null' => TRUE, 'default' => '')
+  );
 
   // Fix up possible {location} problems from previous update that could be caused if you had NULLed fields.
 
@@ -967,35 +1108,87 @@ function location_update_6302() {
   );
   foreach ($fields as $field => $value) {
     db_update('location')
-      ->fields(array(
-        $field => $value,
-      ))
+      ->fields(
+        array(
+          $field => $value,
+        )
+      )
       ->isNull($field)
       ->execute();
   }
 
   // {location}.name -- NOT NULL
-  db_change_field('location', 'name', 'name', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+  db_change_field(
+    'location',
+    'name',
+    'name',
+    array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
+  );
   // {location}.street -- NOT NULL
-  db_change_field('location', 'street', 'street', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+  db_change_field(
+    'location',
+    'street',
+    'street',
+    array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
+  );
   // {location}.additional -- NOT NULL
-  db_change_field('location', 'additional', 'additional', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+  db_change_field(
+    'location',
+    'additional',
+    'additional',
+    array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
+  );
   // {location}.city -- NOT NULL
-  db_change_field('location', 'city', 'city', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+  db_change_field(
+    'location',
+    'city',
+    'city',
+    array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
+  );
   // {location}.province -- NOT NULL
-  db_change_field('location', 'province', 'province', array('type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => ''));
+  db_change_field(
+    'location',
+    'province',
+    'province',
+    array('type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => '')
+  );
   // {location}.postal_code -- NOT NULL
-  db_change_field('location', 'postal_code', 'postal_code', array('type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => ''));
+  db_change_field(
+    'location',
+    'postal_code',
+    'postal_code',
+    array('type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => '')
+  );
   // {location}.country -- NOT NULL
-  db_change_field('location', 'country', 'country', array('type' => 'char', 'length' => 2, 'not null' => TRUE, 'default' => ''));
+  db_change_field(
+    'location',
+    'country',
+    'country',
+    array('type' => 'char', 'length' => 2, 'not null' => TRUE, 'default' => '')
+  );
 
   // {location}.latitude
-  db_change_field('location', 'latitude', 'latitude', array('type' => 'numeric', 'precision' => 10, 'scale' => 6, 'not null' => TRUE, 'default' => 0.0));
+  db_change_field(
+    'location',
+    'latitude',
+    'latitude',
+    array('type' => 'numeric', 'precision' => 10, 'scale' => 6, 'not null' => TRUE, 'default' => 0.0)
+  );
   // {location}.longitude
-  db_change_field('location', 'longitude', 'longitude', array('type' => 'numeric', 'precision' => 10, 'scale' => 6, 'not null' => TRUE, 'default' => 0.0));
+  db_change_field(
+    'location',
+    'longitude',
+    'longitude',
+    array('type' => 'numeric', 'precision' => 10, 'scale' => 6, 'not null' => TRUE, 'default' => 0.0)
+  );
 
   // {location}.source
-  db_change_field('location', 'source', 'source', array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0));
+  db_change_field(
+    'location',
+    'source',
+    'source',
+    array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0)
+  );
 }
 
 /**
@@ -1011,18 +1204,22 @@ function location_update_6303() {
 
     // Update province code for Italy/Forlì-Cesena.
     db_update('location')
-      ->fields(array(
-        'province' => 'FC',
-      ))
+      ->fields(
+        array(
+          'province' => 'FC',
+        )
+      )
       ->condition('country', 'it')
       ->condition('province', 'FO')
       ->execute();
 
     // Update province code for Italy/Pesaro e Urbino.
     db_update('location')
-      ->fields(array(
-        'province' => 'PU',
-      ))
+      ->fields(
+        array(
+          'province' => 'PU',
+        )
+      )
       ->condition('country', 'it')
       ->condition('province', 'PS')
       ->execute();
@@ -1033,7 +1230,7 @@ function location_update_6303() {
     db_delete('location')
       ->condition('lid', $query, 'NOT IN')
       ->execute();
-    
+
     // Garbage collect {location_phone} by hand.
     if (db_table_exists('location_phone')) {
       $query = db_select('location', 'l')
@@ -1063,6 +1260,7 @@ function location_update_6304() {
   // Skip this update if it was already done on the 5.x side.
   if (variable_get('location_update_5305_done', FALSE)) {
     variable_del('location_update_5305_done');
+
     return array();
   }
 
@@ -1089,7 +1287,7 @@ function location_update_6304() {
 
   // Pull in user settings.
   $variables['location_settings_user'] = $base;
-  $tmp = &$variables['location_settings_user'];
+  $tmp = & $variables['location_settings_user'];
   // Users previously could not have multiple locations, initialize with those
   // settings.
   $tmp['multiple'] = array(
@@ -1110,7 +1308,7 @@ function location_update_6304() {
     $todelete[] = $type;
 
     $variables["location_settings_node_$type"] = $base;
-    $tmp = &$variables["location_settings_node_$type"];
+    $tmp = & $variables["location_settings_node_$type"];
 
     $tmp['multiple']['min'] = 1; // Old behavior was to have the first one be required.
     $tmp['multiple']['max'] = variable_get("location_maxnum_$type", 0);
@@ -1120,12 +1318,15 @@ function location_update_6304() {
     $tmp['form']['collapsed'] = variable_get("location_collapsed_$type", TRUE);
     $tmp['form']['fields'] = variable_get("location_fields_$type", array());
     $tmp['rss']['mode'] = variable_get("location_rss_$type", 'simple');
-    $tmp['display'] = variable_get("location_display_$type", array(
-      'teaser' => TRUE,
-      'full' => TRUE,
-      'weight' => 0,
-      'hide' => array(),
-    ));
+    $tmp['display'] = variable_get(
+      "location_display_$type",
+      array(
+        'teaser' => TRUE,
+        'full' => TRUE,
+        'weight' => 0,
+        'hide' => array(),
+      )
+    );
   }
 
   foreach ($variables as $name => $value) {
@@ -1165,6 +1366,7 @@ function location_update_6306() {
   // Skip this update if it was already done on the 5.x side.
   if (variable_get('location_update_5306_done', FALSE)) {
     variable_del('location_update_5306_done');
+
     return array();
   }
 
@@ -1189,13 +1391,18 @@ function location_update_6306() {
  * Tell users about the new location_user module and enable it.
  */
 function location_update_6307() {
-  $message = t("Note: Location module has now split off user location support into a separate module, called <em>User Locations</em>. It has been enabled for you. If you don't want user locations, visit the <a href='!url'>modules page</a> and disable it.", array('!url' => url('admin/modules')));
+  $message = t(
+    "Note: Location module has now split off user location support into a separate module, called <em>User Locations</em>. It has been enabled for you. If you don't want user locations, visit the <a href='!url'>modules page</a> and disable it.",
+    array('!url' => url('admin/modules'))
+  );
 
   if (module_exists('location')) {
     module_enable(array('location_user'));
   }
   else {
-    $message .= '<br />' . t("Note: Refusing to enable location_user.module, as location.module is not currently enabled.");
+    $message .= '<br />' . t(
+        "Note: Refusing to enable location_user.module, as location.module is not currently enabled."
+      );
   }
 
   return $message;
@@ -1205,13 +1412,18 @@ function location_update_6307() {
  * Tell users about the new location_node module and enable it.
  */
 function location_update_6308() {
-  $message = t("Note: Location module has now split off node location support into a separate module, called <em>Node Locations</em>. It has been enabled for you. If you don't want node locations, visit the <a href='!url'>modules page</a> and disable it.", array('!url' => url('admin/modules')));
+  $message = t(
+    "Note: Location module has now split off node location support into a separate module, called <em>Node Locations</em>. It has been enabled for you. If you don't want node locations, visit the <a href='!url'>modules page</a> and disable it.",
+    array('!url' => url('admin/modules'))
+  );
 
   if (module_exists('location')) {
     module_enable(array('location_node'));
   }
   else {
-    $message .= '<br />' . t("Note: Refusing to enable location_node.module, as location.module is not currently enabled.");
+    $message .= '<br />' . t(
+        "Note: Refusing to enable location_node.module, as location.module is not currently enabled."
+      );
   }
 
   return $message;
@@ -1264,7 +1476,10 @@ function location_update_6309() {
   }
 
   if (!empty($updated_views)) {
-    return t("Note: The 'Form type' option for the 'Location: Distance / Proximity' filter in views has been changed and is now the 'Origin' option.  The following views were using that setting and have been updated to use the new setting: %views.", array('%views' => implode(', ', $updated_views)));
+    return t(
+      "Note: The 'Form type' option for the 'Location: Distance / Proximity' filter in views has been changed and is now the 'Origin' option.  The following views were using that setting and have been updated to use the new setting: %views.",
+      array('%views' => implode(', ', $updated_views))
+    );
   }
 }
 
@@ -1276,34 +1491,39 @@ function location_update_6309() {
 function location_update_7301() {
 
   db_update('location')
-    ->fields(array(
-      'country' => 'gb',
-    ))
+    ->fields(
+      array(
+        'country' => 'gb',
+      )
+    )
     ->condition('country', 'uk')
     ->execute();
 
   db_update('zipcodes')
-    ->fields(array(
-      'country' => 'gb',
-    ))
+    ->fields(
+      array(
+        'country' => 'gb',
+      )
+    )
     ->condition('country', 'uk')
     ->execute();
 
   $uk = variable_get('location_geocode_uk', '');
   $gb = variable_get('location_geocode_gb', '');
-  
+
   if ($uk) {
     variable_set('location_geocode_gb', $uk);
   }
-  
+
   $uk = variable_get('location_map_link_uk', '');
   $gb = variable_get('location_map_link_gb', '');
-  
+
   if ($uk) {
     variable_set('location_map_link_gb', $uk);
   }
-  
+
   cache_clear_all('*', 'cache_location', TRUE);
+
   return;
 }
 
@@ -1313,16 +1533,18 @@ function location_update_7301() {
 function location_update_7302() {
   // Create the new table.
   drupal_load('module', 'location');
-  $schema = location_schema() ;
+  $schema = location_schema();
   db_create_table('location_country', $schema['location_country']);
 
   $countries = location_get_iso3166_list();
-  foreach($countries as $code => $name){
+  foreach ($countries as $code => $name) {
     db_insert('location_country')
-    ->fields(array(
-      'code' => $code,
-      'name' => $name,
-    ))
-    ->execute();
+      ->fields(
+        array(
+          'code' => $code,
+          'name' => $name,
+        )
+      )
+      ->execute();
   }
 }
diff --git a/location.migrate.inc b/location.migrate.inc
index 486b521..2ce834b 100644
--- a/location.migrate.inc
+++ b/location.migrate.inc
@@ -40,6 +40,7 @@ function location_migrate_api() {
 *   $this->addFieldMapping('field_location_dest:city', 'field_source_city');
 * @endcode
 */
+
 class MigrateLocationFieldHandler extends MigrateFieldHandler {
 
   public function __construct() {
diff --git a/location.module b/location.module
index 52e728b..cabb4a8 100644
--- a/location.module
+++ b/location.module
@@ -117,19 +117,30 @@ function location_permission() {
 function location_help($path, $arg) {
   switch ($path) {
     case 'admin/help#location':
-      $output = '<p>' . t('The location module allows you to associate a geographic location with content and users. Users can do proximity searches by postal code.  This is useful for organizing communities that have a geographic presence.') . '</p>';
-      $output .= '<p>' . t('To administer locative information for content, use the content type administration page.  To support most location enabled features, you will need to install the country specific include file.  To support postal code proximity searches for a particular country, you will need a database dump of postal code data for that country.  As of June 2007 only U.S. and German postal codes are supported.') . '</p>';
-      $output .= t('<p>You can</p>
-<ul>
-<li>administer locative information at <a href="@admin-node-configure-types">Administer &gt;&gt; Content management &gt;&gt; Content types</a> to configure a type and see the locative information.</li>
-<li>administer location at <a href="@admin-settings-location">Administer &gt;&gt; Site configuration &gt;&gt; Location</a>.</li>
-<li>use a database dump for a U.S. and/or German postal codes table that can be found at <a href="@external-http-cvs-drupal-org">zipcode database</a>.</li>
-', array(
-        '@admin-node-configure-types' => url('admin/content/types'),
-        '@admin-settings-location' => url('admin/config/content/location'),
-        '@external-http-cvs-drupal-org' => 'http://cvs.drupal.org/viewcvs/drupal/contributions/modules/location/database/'
-      )) . '</ul>';
-      $output .= '<p>' . t('For more information read the configuration and customization handbook <a href="@location">Location page</a>.', array('@location' => 'http://www.drupal.org/handbook/modules/location/')) . '</p>';
+      $output = '<p>' . t(
+          'The location module allows you to associate a geographic location with content and users. Users can do proximity searches by postal code.  This is useful for organizing communities that have a geographic presence.'
+        ) . '</p>';
+      $output .= '<p>' . t(
+          'To administer locative information for content, use the content type administration page.  To support most location enabled features, you will need to install the country specific include file.  To support postal code proximity searches for a particular country, you will need a database dump of postal code data for that country.  As of June 2007 only U.S. and German postal codes are supported.'
+        ) . '</p>';
+      $output .= t(
+          '<p>You can</p>
+          <ul>
+          <li>administer locative information at <a href="@admin-node-configure-types">Administer &gt;&gt; Content management &gt;&gt; Content types</a> to configure a type and see the locative information.</li>
+          <li>administer location at <a href="@admin-settings-location">Administer &gt;&gt; Site configuration &gt;&gt; Location</a>.</li>
+          <li>use a database dump for a U.S. and/or German postal codes table that can be found at <a href="@external-http-cvs-drupal-org">zipcode database</a>.</li>
+          ',
+          array(
+            '@admin-node-configure-types' => url('admin/content/types'),
+            '@admin-settings-location' => url('admin/config/content/location'),
+            '@external-http-cvs-drupal-org' => 'http://cvs.drupal.org/viewcvs/drupal/contributions/modules/location/database/'
+          )
+        ) . '</ul>';
+      $output .= '<p>' . t(
+          'For more information read the configuration and customization handbook <a href="@location">Location page</a>.',
+          array('@location' => 'http://www.drupal.org/handbook/modules/location/')
+        ) . '</p>';
+
       return $output;
   }
 }
@@ -173,6 +184,7 @@ function location_field_extra_fields() {
       );
     }
   }
+
   return $info;
 }
 
@@ -192,6 +204,7 @@ function theme_location_element($variables) {
 
   // Prevent spurious "Array" from appearing.
   unset($element['#value']);
+
   return theme('fieldset', array('element' => $element));
 }
 
@@ -327,7 +340,13 @@ function _location_process_location($element, $form_state) {
       // @@@ Permission check hook?
       if ($fsettings[$field]['collect'] != 0) {
         $fsettings[$field]['#parents'] = $element['#parents'];
-        $element[$field] = location_invoke_locationapi($fdefaults[$field], 'field_expand', $field, $fsettings[$field], $fdefaults);
+        $element[$field] = location_invoke_locationapi(
+          $fdefaults[$field],
+          'field_expand',
+          $field,
+          $fsettings[$field],
+          $fdefaults
+        );
         $element[$field]['#weight'] = (int) $fsettings[$field]['weight'];
       }
     }
@@ -414,7 +433,9 @@ function _location_process_location($element, $form_state) {
       '#type' => 'markup',
       '#weight' => 1,
       '#prefix' => '<div class=\'description\'>',
-      '#markup' => '<br /><br />' . t('If you wish to supply your own latitude and longitude, you may enter them above.  If you leave these fields blank, the system will attempt to determine a latitude and longitude for you from the entered address.  To have the system recalculate your location from the address, for example if you change the address, delete the values for these fields.'),
+      '#markup' => '<br /><br />' . t(
+          'If you wish to supply your own latitude and longitude, you may enter them above.  If you leave these fields blank, the system will attempt to determine a latitude and longitude for you from the entered address.  To have the system recalculate your location from the address, for example if you change the address, delete the values for these fields.'
+        ),
       '#suffix' => '</div>',
     );
     if (function_exists('gmap_get_auto_mapid') && variable_get('location_usegmap', FALSE)) {
@@ -456,7 +477,9 @@ function _location_process_location($element, $form_state) {
         '#type' => 'markup',
         '#weight' => 2,
         '#prefix' => '<div class=\'description\'>',
-        '#markup' => t('You may set the location by clicking on the map, or dragging the location marker.  To clear the location and cause it to be recalculated, click on the marker.'),
+        '#markup' => t(
+          'You may set the location by clicking on the map, or dragging the location marker.  To clear the location and cause it to be recalculated, click on the marker.'
+        ),
         '#suffix' => '</div>',
       );
     }
@@ -481,6 +504,7 @@ function _location_process_location($element, $form_state) {
   }
 
   drupal_alter('location_element', $element);
+
   return $element;
 }
 
@@ -611,11 +635,15 @@ function theme_location_settings($variables) {
 
   drupal_add_tabledrag('location-settings-table', 'order', 'sibling', 'location-settings-weight');
 
-  $output = theme('table', array(
-    'header' => $header,
-    'rows' => $rows,
-    'attributes' => array('id' => 'location-settings-table')
-  ));
+  $output = theme(
+    'table',
+    array(
+      'header' => $header,
+      'rows' => $rows,
+      'attributes' => array('id' => 'location-settings-table')
+    )
+  );
+
   //return theme('form_element', array('element' => $element));
   return $output;
 }
@@ -631,6 +659,7 @@ function location_field_names($all = FALSE) {
       $virtual = location_invoke_locationapi($dummy, 'virtual fields');
       $allfields += $virtual;
     }
+
     return $allfields;
   }
   else {
@@ -638,6 +667,7 @@ function location_field_names($all = FALSE) {
       $dummy = array();
       $fields = location_invoke_locationapi($dummy, 'fields');
     }
+
     return $fields;
   }
 }
@@ -720,7 +750,11 @@ function location_locationapi(&$obj, $op, $a3 = NULL, $a4 = NULL, $a5 = NULL) {
       if (!empty($obj['locpick']) && is_array($obj['locpick'])) {
         // Can't specify just latitude or just longitude.
         if (isset($obj['locpick']['user_latitude']) && isset($obj['locpick']['user_longitude'])) {
-          if (_location_floats_are_equal($obj['locpick']['user_latitude'], 0) xor _location_floats_are_equal($obj['locpick']['user_longitude'], 0)) {
+          if (_location_floats_are_equal($obj['locpick']['user_latitude'], 0) xor _location_floats_are_equal(
+              $obj['locpick']['user_longitude'],
+              0
+            )
+          ) {
             $ref = & $a3['locpick']['user_latitude'];
             if (_location_floats_are_equal($obj['locpick']['user_longitude'], 0)) {
               $ref = & $a3['locpick']['user_longitude'];
@@ -809,6 +843,7 @@ function location_locationapi(&$obj, $op, $a3 = NULL, $a4 = NULL, $a5 = NULL) {
               else {
                 $wrapper_suffix = '';
               }
+
               return array(
                 '#type' => 'select',
                 '#title' => t('State/Province'),
@@ -822,6 +857,7 @@ function location_locationapi(&$obj, $op, $a3 = NULL, $a4 = NULL, $a5 = NULL) {
             case 'autocomplete':
             default:
               drupal_add_js(drupal_get_path('module', 'location') . '/location_autocomplete.js');
+
               return array(
                 '#type' => 'textfield',
                 '#title' => t('State/Province'),
@@ -845,10 +881,13 @@ function location_locationapi(&$obj, $op, $a3 = NULL, $a4 = NULL, $a5 = NULL) {
             );
           }
           else {
-            $options = array_merge(array(
-              '' => t('Select'),
-              'xx' => t('NOT LISTED')
-            ), location_get_iso3166_list());
+            $options = array_merge(
+              array(
+                '' => t('Select'),
+                'xx' => t('NOT LISTED')
+              ),
+              location_get_iso3166_list()
+            );
             if (!empty($settings['#parents'])) {
               $wrapper_suffix = '-' . implode('-', $settings['#parents']);
             }
@@ -856,6 +895,7 @@ function location_locationapi(&$obj, $op, $a3 = NULL, $a4 = NULL, $a5 = NULL) {
               $settings['#parents'] = array();
               $wrapper_suffix = '';
             }
+
             return array(
               '#type' => 'select',
               '#title' => t('Country'),
@@ -931,8 +971,13 @@ function location_geocoding_parameters_page($country_iso, $service) {
   $breadcrumbs[] = l('location', 'admin/config/content/location');
   $breadcrumbs[] = l('geocoding', 'admin/config/content/location/geocoding');
   $countries = location_get_iso3166_list();
-  $breadcrumbs[] = l($countries[$country_iso], 'admin/config/content/location/geocoding', array('fragment' => $country_iso));
+  $breadcrumbs[] = l(
+    $countries[$country_iso],
+    'admin/config/content/location/geocoding',
+    array('fragment' => $country_iso)
+  );
   drupal_set_breadcrumb($breadcrumbs);
+
   return drupal_get_form('location_geocoding_parameters_form', $country_iso, $service);
 }
 
@@ -948,10 +993,14 @@ function location_geocoding_parameters_form($form, &$form_state, $country_iso, $
     return system_settings_form($geocode_settings_form_function_general());
   }
   else {
-    return system_settings_form(array(
-      '#type' => 'markup',
-      '#markup' => t('No configuration parameters are necessary, or a form to take such paramters has not been implemented.')
-    ));
+    return system_settings_form(
+      array(
+        '#type' => 'markup',
+        '#markup' => t(
+          'No configuration parameters are necessary, or a form to take such paramters has not been implemented.'
+        )
+      )
+    );
   }
 }
 
@@ -977,6 +1026,7 @@ function location_load_locations($id, $key = 'vid') {
   foreach ($result as $lid) {
     $locations[] = location_load_location($lid->{$lid_field});
   }
+
   return $locations;
 }
 
@@ -1038,7 +1088,10 @@ function location_save_locations(&$locations, $criteria) {
     // Check anything that dropped a reference during this operation.
     foreach (array_diff($oldlids, $newlids) as $check) {
       // An instance may have been deleted. Check reference count.
-      $count = db_query('SELECT COUNT(*) FROM {location_instance} WHERE lid = :lid', array(':lid' => $check))->fetchField();
+      $count = db_query(
+        'SELECT COUNT(*) FROM {location_instance} WHERE lid = :lid',
+        array(':lid' => $check)
+      )->fetchField();
 
       if ($count !== FALSE && $count == 0) {
         watchdog('location', 'Deleting unreferenced location with LID %lid.', array('%lid' => $check));
@@ -1078,11 +1131,13 @@ function location_load_location($lid) {
     if (variable_get('location_jit_geocoding', FALSE)) {
       _location_geo_logic($location, array('street' => 1), array());
       db_update('location')
-        ->fields(array(
-          'latitude' => $location['latitude'],
-          'longitude' => $location['longitude'],
-          'source' => $location['source'],
-        ))
+        ->fields(
+          array(
+            'latitude' => $location['latitude'],
+            'longitude' => $location['longitude'],
+            'source' => $location['source'],
+          )
+        )
         ->condition('lid', $location['lid'])
         ->execute();
     }
@@ -1164,11 +1219,19 @@ function _location_country_ajax_callback($form, $form_state) {
     return $form['locations'][arg(3)]['province'];
   }
   elseif (isset($form[arg(2)][arg(3)][arg(4)])) {
-    if (isset($form[arg(2)][arg(3)][arg(4)]['#entity_type']) && $form[arg(2)][arg(3)][arg(4)]['#entity_type'] == 'field_collection_item') {
+    if (isset($form[arg(2)][arg(3)][arg(4)]['#entity_type']) && $form[arg(2)][arg(3)][arg(
+        4
+      )]['#entity_type'] == 'field_collection_item'
+    ) {
       $selected_country_value = $form[arg(2)][arg(3)][arg(4)][arg(5)][arg(6)][arg(7)]['country']['#value'];
-      $form[arg(2)][arg(3)][arg(4)][arg(5)][arg(6)][arg(7)]['province']['#options'] = array('' => t('Select'), 'xx' => t('NOT LISTED')) + location_get_provinces($selected_country_value);
+      $form[arg(2)][arg(3)][arg(4)][arg(5)][arg(6)][arg(7)]['province']['#options'] = array(
+          '' => t('Select'),
+          'xx' => t('NOT LISTED')
+        ) + location_get_provinces($selected_country_value);
+
       return $form[arg(2)][arg(3)][arg(4)][arg(5)][arg(6)][arg(7)]['province'];
     }
+
     return $form[arg(2)][arg(3)][arg(4)]['province'];
   }
 }
@@ -1181,6 +1244,7 @@ function _location_country_ajax_callback($form, $form_state) {
 function _location_floats_are_equal($x, $y) {
   $x = floatval($x);
   $y = floatval($y);
+
   return (abs(max($x, $y) - min($x, $y)) < pow(10, -6));
 }
 
@@ -1205,7 +1269,11 @@ function location_has_coordinates($location, $canonical = FALSE) {
   }
 
   // If the latitude or longitude are zeroed (Although it could be a good idea to relax this slightly sometimes)
-  if (_location_floats_are_equal($location['latitude'], 0.0) || _location_floats_are_equal($location['longitude'], 0.0)) {
+  if (_location_floats_are_equal($location['latitude'], 0.0) || _location_floats_are_equal(
+      $location['longitude'],
+      0.0
+    )
+  ) {
     return FALSE;
   }
 
@@ -1217,7 +1285,7 @@ function location_has_coordinates($location, $canonical = FALSE) {
  *
  * @param &$location A location object.
  * @param $op A string containing the name of the locationapi operation.
- * @param $a3, $a4, $a5 Arguments to pass on to the hook.
+ * @param $a3 , $a4, $a5 Arguments to pass on to the hook.
  * @return The returned value of the invoked hooks.
  */
 function location_invoke_locationapi(&$location, $op, $a3 = NULL, $a4 = NULL, $a5 = NULL) {
@@ -1232,6 +1300,7 @@ function location_invoke_locationapi(&$location, $op, $a3 = NULL, $a4 = NULL, $a
       $return[] = $result;
     }
   }
+
   return $return;
 }
 
@@ -1252,6 +1321,7 @@ function _location_patch_locpick(&$location) {
     $location['longitude'] = $location['locpick']['user_longitude'];
     $inhibit_geocode = TRUE;
   }
+
   return $inhibit_geocode;
 }
 
@@ -1286,6 +1356,7 @@ function location_save(&$location, $cow = TRUE, $criteria = array()) {
     // Location is being deleted.
     // Consider it empty and return early.
     $location['lid'] = FALSE;
+
     return FALSE;
   }
 
@@ -1307,6 +1378,7 @@ function location_save(&$location, $cow = TRUE, $criteria = array()) {
   if (location_is_empty($location, $filled)) {
     // This location was empty, we don't need to continue.
     $location['lid'] = FALSE;
+
     return FALSE;
   }
 
@@ -1319,6 +1391,7 @@ function location_save(&$location, $cow = TRUE, $criteria = array()) {
     else {
       // Unfilled location (@@@ Then how did we get here?)
       $location['lid'] = FALSE;
+
       return FALSE;
     }
   }
@@ -1337,7 +1410,10 @@ function location_save(&$location, $cow = TRUE, $criteria = array()) {
           $query->condition($key, $value);
         }
         $associated = $query->countQuery()->execute()->fetchField();
-        $all = db_query("SELECT COUNT(*) FROM {location_instance} WHERE lid = :lid", array(':lid' => $location['lid']))->fetchField();
+        $all = db_query(
+          "SELECT COUNT(*) FROM {location_instance} WHERE lid = :lid",
+          array(':lid' => $location['lid'])
+        )->fetchField();
         if ($associated != $all) {
           // If there were a different number of instances than instances matching the criteria,
           // we need a new LID.
@@ -1384,6 +1460,7 @@ function location_save(&$location, $cow = TRUE, $criteria = array()) {
   }
 
   location_invoke_locationapi($location, 'save');
+
   return $location['lid'];
 }
 
@@ -1430,6 +1507,7 @@ function location_calc_difference($oldloc, $newloc, &$changes) {
   if (!$location_changed) {
     return FALSE;
   }
+
   return TRUE;
 }
 
@@ -1481,6 +1559,7 @@ function location_empty_location($settings) {
       $location[$k] = $v['default'];
     }
   }
+
   return $location;
 }
 
@@ -1640,6 +1719,7 @@ function location_dd_to_dms($coord) {
   $coord -= $minutes;
   $coord *= 60;
   $seconds = round($coord, 6);
+
   return array($degrees, $minutes, $seconds, $negative);
 }
 
@@ -1657,6 +1737,7 @@ function theme_location_latitude_dms($variables) {
   else {
     $output .= 'S';
   }
+
   return $output;
 }
 
@@ -1671,6 +1752,7 @@ function theme_location_longitude_dms($variables) {
   else {
     $output .= 'W';
   }
+
   return $output;
 }
 
@@ -1679,6 +1761,7 @@ function theme_location_longitude_dms($variables) {
  */
 function location_token_values($type, $object = NULL) {
   require_once(DRUPAL_ROOT . '/' . drupal_get_path('module', 'location') . '/location.token.inc');
+
   return _location_token_values($type, $object);
 }
 
@@ -1687,6 +1770,7 @@ function location_token_values($type, $object = NULL) {
  */
 function location_token_list($type = 'all') {
   require_once(DRUPAL_ROOT . '/' . drupal_get_path('module', 'location') . '/location.token.inc');
+
   return _location_token_list($type);
 }
 
@@ -1755,7 +1839,10 @@ function template_preprocess_location(&$variables) {
   if (!isset($location['province_name'])) {
     $location['province_name'] = '';
   }
-  $variables['province_print'] = variable_get('location_use_province_abbreviation', 1) ? $location['province'] : $location['province_name'];
+  $variables['province_print'] = variable_get(
+    'location_use_province_abbreviation',
+    1
+  ) ? $location['province'] : $location['province_name'];
 }
 
 /**
@@ -1850,7 +1937,9 @@ function location_settings($old = FALSE) {
     '#type' => 'weight',
     '#title' => t('Location form weight'),
     '#default_value' => isset($old['form']['weight']) ? $old['form']['weight'] : 0,
-    '#description' => t('Weight of the location box in the add / edit form. Lower values will be displayed higher in the form.'),
+    '#description' => t(
+      'Weight of the location box in the add / edit form. Lower values will be displayed higher in the form.'
+    ),
   );
   $form['form']['collapsible'] = array(
     '#type' => 'checkbox',
@@ -1968,6 +2057,7 @@ function location_display($settings, $locations) {
     return array();
   }
   $hide = array_keys(array_filter($settings['display']['hide']));
+
   // Show all locations
   return array(
     '#type' => 'markup',
@@ -1980,6 +2070,7 @@ function location_display($settings, $locations) {
 
 function location_rss_item($location, $mode = 'simple') {
   require_once(DRUPAL_ROOT . '/' . drupal_get_path('module', 'location') . '/location.georss.inc');
+
   return _location_rss_item($location, $mode);
 }
 
diff --git a/location.token.inc b/location.token.inc
index d0f6380..9ea3672 100644
--- a/location.token.inc
+++ b/location.token.inc
@@ -36,6 +36,7 @@ function _location_token_values($type, $object = NULL) {
         $values["location-provincename_$key"] = $values["location-province_name_$key"];
         $values["location-countryname_$key"] = $values["location-country_name_$key"];
       }
+
       return $values;
     }
   }
@@ -46,17 +47,40 @@ function _location_token_values($type, $object = NULL) {
  */
 function _location_token_list($type = 'all') {
   if ($type == 'node' || $type == 'user' || $type == 'all') {
-    $tokens['location']['location-name_N'] = t('Location Name (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-street_N'] = t('Street (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-additional_N'] = t('Additional (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-city_N'] = t('City (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-province_N'] = t('State/Province (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-province_name_N'] = t('State/Province Name (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-postal_code_N'] = t('Postal Code (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-latitude_N'] = t('Latitude (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-longitude_N'] = t('Longitude (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-country_N'] = t('Country (If there are multiple locations per node, N is the iteration, starting with 0)');
-    $tokens['location']['location-country_name_N'] = t('Country Name (If there are multiple locations per node, N is the iteration, starting with 0)');
+    $tokens['location']['location-name_N'] = t(
+      'Location Name (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-street_N'] = t(
+      'Street (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-additional_N'] = t(
+      'Additional (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-city_N'] = t(
+      'City (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-province_N'] = t(
+      'State/Province (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-province_name_N'] = t(
+      'State/Province Name (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-postal_code_N'] = t(
+      'Postal Code (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-latitude_N'] = t(
+      'Latitude (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-longitude_N'] = t(
+      'Longitude (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-country_N'] = t(
+      'Country (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+    $tokens['location']['location-country_name_N'] = t(
+      'Country Name (If there are multiple locations per node, N is the iteration, starting with 0)'
+    );
+
     return $tokens;
   }
 }
diff --git a/location.tokens.inc b/location.tokens.inc
index 5340c0b..c134b08 100644
--- a/location.tokens.inc
+++ b/location.tokens.inc
@@ -163,8 +163,10 @@ function _locations_token_helper($locations, $location_key, $which = 0, array $o
   if ($location_key == 'country_name') {
     if (!empty($locations[$which]['country'])) {
       $val = location_country_name($locations[$which]['country']);
+
       return $sanitize ? check_plain($val) : $val;
     }
+
     return '';
   }
 
@@ -172,8 +174,10 @@ function _locations_token_helper($locations, $location_key, $which = 0, array $o
   if ($location_key == 'province_name') {
     if (!empty($locations[$which]['country']) && !empty($locations[$which]['province'])) {
       $val = location_province_name($locations[$which]['country'], $locations[$which]['province']);
+
       return $sanitize ? check_plain($val) : $val;
     }
+
     return '';
   }
 
@@ -181,5 +185,6 @@ function _locations_token_helper($locations, $location_key, $which = 0, array $o
   if (!empty($locations[$which][$location_key])) {
     return $sanitize ? check_plain($locations[$which][$location_key]) : $locations[$which][$location_key];
   }
+
   return '';
 }
diff --git a/location.views.inc b/location.views.inc
index 0306c8f..25db35a 100644
--- a/location.views.inc
+++ b/location.views.inc
@@ -446,6 +446,7 @@ function location_views_proximity_get_location_field_options() {
       }
     }
   }
+
   return $field_options;
 }
 
@@ -480,6 +481,7 @@ function location_views_proximity_get_argument_options($view) {
       }
     }
   }
+
   return array($nid_argument_options, $uid_argument_options);
 }
 
@@ -536,7 +538,10 @@ function location_views_proximity_get_reference_location($view, $options) {
         }
       }
       // If at this stage we don't have coordinates then check for a distance contextual filter
-      if (!count($coordinates) && !empty($view->argument) && !empty($argument->value['latitude']) && !empty($argument->value['longitude'])) {
+      if (!count(
+          $coordinates
+        ) && !empty($view->argument) && !empty($argument->value['latitude']) && !empty($argument->value['longitude'])
+      ) {
         foreach ($view->argument as $argument) {
           if ($argument->table == 'location' && $argument->field == 'distance') {
             $coordinates['latitude'] = (float) $argument->value['latitude'];
diff --git a/location.views_default.inc b/location.views_default.inc
index 16adaab..86f41fd 100644
--- a/location.views_default.inc
+++ b/location.views_default.inc
@@ -19,167 +19,185 @@ function location_views_default_views() {
   $view->api_version = 2;
   $view->disabled = TRUE;
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
-    'title' => array(
-      'label' => 'Title',
-      'link_to_node' => 1,
-      'exclude' => 0,
-      'id' => 'title',
-      'table' => 'node',
-      'field' => 'title',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'street' => array(
-      'label' => 'Street',
-      'style' => 'both',
-      'exclude' => 0,
-      'id' => 'street',
-      'table' => 'location',
-      'field' => 'street',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'city' => array(
-      'label' => 'City',
-      'exclude' => 0,
-      'id' => 'city',
-      'table' => 'location',
-      'field' => 'city',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'province' => array(
-      'label' => 'Province',
-      'style' => 'name',
-      'exclude' => 0,
-      'id' => 'province',
-      'table' => 'location',
-      'field' => 'province',
-      'relationship' => 'none',
-    ),
-    'postal_code' => array(
-      'label' => 'Postal Code',
-      'exclude' => 0,
-      'id' => 'postal_code',
-      'table' => 'location',
-      'field' => 'postal_code',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'country' => array(
-      'label' => 'Country',
-      'style' => 'name',
-      'exclude' => 0,
-      'id' => 'country',
-      'table' => 'location',
-      'field' => 'country',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'status_extra' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'status_extra',
-      'table' => 'node',
-      'field' => 'status_extra',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'lid' => array(
-      'operator' => 'not empty',
-      'value' => array(
-        'value' => '',
-        'min' => '',
-        'max' => '',
-      ),
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'lid',
-      'table' => 'location',
-      'field' => 'lid',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'view node location table',
-  ));
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'columns' => array(
-      'title' => 'title',
-      'street' => 'street',
-      'city' => 'city',
-      'province' => 'province',
-      'postal_code' => 'postal_code',
-      'country' => 'country',
-    ),
-    'info' => array(
+  $handler->override_option(
+    'fields',
+    array(
       'title' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Title',
+        'link_to_node' => 1,
+        'exclude' => 0,
+        'id' => 'title',
+        'table' => 'node',
+        'field' => 'title',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
       ),
       'street' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Street',
+        'style' => 'both',
+        'exclude' => 0,
+        'id' => 'street',
+        'table' => 'location',
+        'field' => 'street',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
       ),
       'city' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'City',
+        'exclude' => 0,
+        'id' => 'city',
+        'table' => 'location',
+        'field' => 'city',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
       ),
       'province' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Province',
+        'style' => 'name',
+        'exclude' => 0,
+        'id' => 'province',
+        'table' => 'location',
+        'field' => 'province',
+        'relationship' => 'none',
       ),
       'postal_code' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Postal Code',
+        'exclude' => 0,
+        'id' => 'postal_code',
+        'table' => 'location',
+        'field' => 'postal_code',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
       ),
       'country' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-    ),
-    'default' => '-1',
-  ));
+        'label' => 'Country',
+        'style' => 'name',
+        'exclude' => 0,
+        'id' => 'country',
+        'table' => 'location',
+        'field' => 'country',
+        'relationship' => 'none',
+      ),
+    )
+  );
+  $handler->override_option(
+    'filters',
+    array(
+      'status_extra' => array(
+        'operator' => '=',
+        'value' => '',
+        'group' => '0',
+        'exposed' => FALSE,
+        'expose' => array(
+          'operator' => FALSE,
+          'label' => '',
+        ),
+        'id' => 'status_extra',
+        'table' => 'node',
+        'field' => 'status_extra',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
+      ),
+      'lid' => array(
+        'operator' => 'not empty',
+        'value' => array(
+          'value' => '',
+          'min' => '',
+          'max' => '',
+        ),
+        'group' => '0',
+        'exposed' => FALSE,
+        'expose' => array(
+          'operator' => FALSE,
+          'label' => '',
+        ),
+        'id' => 'lid',
+        'table' => 'location',
+        'field' => 'lid',
+        'relationship' => 'none',
+      ),
+    )
+  );
+  $handler->override_option(
+    'access',
+    array(
+      'type' => 'perm',
+      'perm' => 'view node location table',
+    )
+  );
+  $handler->override_option('style_plugin', 'table');
+  $handler->override_option(
+    'style_options',
+    array(
+      'grouping' => '',
+      'override' => 1,
+      'sticky' => 0,
+      'order' => 'asc',
+      'columns' => array(
+        'title' => 'title',
+        'street' => 'street',
+        'city' => 'city',
+        'province' => 'province',
+        'postal_code' => 'postal_code',
+        'country' => 'country',
+      ),
+      'info' => array(
+        'title' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'street' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'city' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'province' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'postal_code' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'country' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+      ),
+      'default' => '-1',
+    )
+  );
   $handler = $view->new_display('page', 'Page', 'page_1');
   $handler->override_option('path', 'location/views');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Location table',
-    'weight' => '0',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'weight' => 0,
-  ));
+  $handler->override_option(
+    'menu',
+    array(
+      'type' => 'normal',
+      'title' => 'Location table',
+      'weight' => '0',
+    )
+  );
+  $handler->override_option(
+    'tab_options',
+    array(
+      'type' => 'none',
+      'title' => '',
+      'weight' => 0,
+    )
+  );
   $views[$view->name] = $view;
 
 
@@ -193,250 +211,271 @@ function location_views_default_views() {
   $view->api_version = 2;
   $view->disabled = TRUE;
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
-    'title' => array(
-      'label' => 'Title',
-      'link_to_node' => 1,
-      'exclude' => 0,
-      'id' => 'title',
-      'table' => 'node',
-      'field' => 'title',
-      'relationship' => 'none',
-    ),
-    'street' => array(
-      'label' => 'Street',
-      'style' => 'both',
-      'exclude' => 0,
-      'id' => 'street',
-      'table' => 'location',
-      'field' => 'street',
-      'relationship' => 'none',
-    ),
-    'city' => array(
-      'label' => 'City',
-      'exclude' => 0,
-      'id' => 'city',
-      'table' => 'location',
-      'field' => 'city',
-      'relationship' => 'none',
-    ),
-    'province' => array(
-      'label' => 'Province',
-      'style' => 'name',
-      'exclude' => 0,
-      'id' => 'province',
-      'table' => 'location',
-      'field' => 'province',
-      'relationship' => 'none',
-    ),
-    'postal_code' => array(
-      'label' => 'Postal Code',
-      'exclude' => 0,
-      'id' => 'postal_code',
-      'table' => 'location',
-      'field' => 'postal_code',
-      'relationship' => 'none',
-    ),
-    'country' => array(
-      'label' => 'Country',
-      'style' => 'name',
-      'exclude' => 0,
-      'id' => 'country',
-      'table' => 'location',
-      'field' => 'country',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('arguments', array(
-    'country' => array(
-      'default_action' => 'summary asc',
-      'style_plugin' => 'default_summary',
-      'style_options' => array(
-        'count' => 1,
-        'override' => 0,
-        'items_per_page' => '25',
-      ),
-      'wildcard' => 'all',
-      'wildcard_substitution' => 'All',
-      'title' => '%1',
-      'default_argument_type' => 'fixed',
-      'default_argument' => '',
-      'validate_type' => 'none',
-      'validate_fail' => 'not found',
-      'id' => 'country',
-      'table' => 'location',
-      'field' => 'country',
-      'relationship' => 'none',
-      'default_options_div_prefix' => '',
-      'default_argument_fixed' => '',
-      'default_argument_php' => '',
-      'validate_argument_node_type' => array(
-        'page' => 0,
-        'story' => 0,
-      ),
-      'validate_argument_node_access' => 0,
-      'validate_argument_nid_type' => 'nid',
-      'validate_argument_php' => '',
-    ),
-    'province' => array(
-      'default_action' => 'summary asc',
-      'style_plugin' => 'default_summary',
-      'style_options' => array(
-        'count' => 1,
-        'override' => 0,
-        'items_per_page' => '25',
-      ),
-      'wildcard' => 'all',
-      'wildcard_substitution' => 'All',
-      'title' => '%2',
-      'default_argument_type' => 'fixed',
-      'default_argument' => '',
-      'validate_type' => 'none',
-      'validate_fail' => 'not found',
-      'id' => 'province',
-      'table' => 'location',
-      'field' => 'province',
-      'relationship' => 'none',
-      'default_options_div_prefix' => '',
-      'default_argument_fixed' => '',
-      'default_argument_php' => '',
-      'validate_argument_node_type' => array(
-        'page' => 0,
-        'story' => 0,
-      ),
-      'validate_argument_node_access' => 0,
-      'validate_argument_nid_type' => 'nid',
-      'validate_argument_php' => '',
-    ),
-    'city' => array(
-      'default_action' => 'summary asc',
-      'style_plugin' => 'default_summary',
-      'style_options' => array(
-        'count' => 1,
-        'override' => 0,
-        'items_per_page' => '25',
-      ),
-      'wildcard' => 'all',
-      'wildcard_substitution' => 'All',
-      'title' => '%3',
-      'default_argument_type' => 'fixed',
-      'default_argument' => '',
-      'validate_type' => 'none',
-      'validate_fail' => 'not found',
-      'glossary' => 1,
-      'limit' => '1',
-      'case' => 'none',
-      'path_case' => 'none',
-      'transform_dash' => 0,
-      'id' => 'city',
-      'table' => 'location',
-      'field' => 'city',
-      'relationship' => 'none',
-      'default_options_div_prefix' => '',
-      'default_argument_fixed' => '',
-      'default_argument_php' => '',
-      'validate_argument_node_type' => array(
-        'page' => 0,
-        'story' => 0,
-      ),
-      'validate_argument_node_access' => 0,
-      'validate_argument_nid_type' => 'nid',
-      'validate_argument_php' => '',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'status_extra' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'status_extra',
-      'table' => 'node',
-      'field' => 'status_extra',
-      'relationship' => 'none',
-    ),
-    'lid' => array(
-      'operator' => 'not empty',
-      'value' => array(
-        'value' => '',
-        'min' => '',
-        'max' => '',
-      ),
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'lid',
-      'table' => 'location',
-      'field' => 'lid',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'view location directory',
-  ));
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'columns' => array(
-      'title' => 'title',
-      'street' => 'street',
-      'city' => 'city',
-      'province' => 'province',
-      'postal_code' => 'postal_code',
-      'country' => 'country',
-    ),
-    'info' => array(
+  $handler->override_option(
+    'fields',
+    array(
       'title' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Title',
+        'link_to_node' => 1,
+        'exclude' => 0,
+        'id' => 'title',
+        'table' => 'node',
+        'field' => 'title',
+        'relationship' => 'none',
       ),
       'street' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Street',
+        'style' => 'both',
+        'exclude' => 0,
+        'id' => 'street',
+        'table' => 'location',
+        'field' => 'street',
+        'relationship' => 'none',
       ),
       'city' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'City',
+        'exclude' => 0,
+        'id' => 'city',
+        'table' => 'location',
+        'field' => 'city',
+        'relationship' => 'none',
       ),
       'province' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Province',
+        'style' => 'name',
+        'exclude' => 0,
+        'id' => 'province',
+        'table' => 'location',
+        'field' => 'province',
+        'relationship' => 'none',
       ),
       'postal_code' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Postal Code',
+        'exclude' => 0,
+        'id' => 'postal_code',
+        'table' => 'location',
+        'field' => 'postal_code',
+        'relationship' => 'none',
       ),
       'country' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Country',
+        'style' => 'name',
+        'exclude' => 0,
+        'id' => 'country',
+        'table' => 'location',
+        'field' => 'country',
+        'relationship' => 'none',
+      ),
+    )
+  );
+  $handler->override_option(
+    'arguments',
+    array(
+      'country' => array(
+        'default_action' => 'summary asc',
+        'style_plugin' => 'default_summary',
+        'style_options' => array(
+          'count' => 1,
+          'override' => 0,
+          'items_per_page' => '25',
+        ),
+        'wildcard' => 'all',
+        'wildcard_substitution' => 'All',
+        'title' => '%1',
+        'default_argument_type' => 'fixed',
+        'default_argument' => '',
+        'validate_type' => 'none',
+        'validate_fail' => 'not found',
+        'id' => 'country',
+        'table' => 'location',
+        'field' => 'country',
+        'relationship' => 'none',
+        'default_options_div_prefix' => '',
+        'default_argument_fixed' => '',
+        'default_argument_php' => '',
+        'validate_argument_node_type' => array(
+          'page' => 0,
+          'story' => 0,
+        ),
+        'validate_argument_node_access' => 0,
+        'validate_argument_nid_type' => 'nid',
+        'validate_argument_php' => '',
       ),
-    ),
-    'default' => '-1',
-  ));
+      'province' => array(
+        'default_action' => 'summary asc',
+        'style_plugin' => 'default_summary',
+        'style_options' => array(
+          'count' => 1,
+          'override' => 0,
+          'items_per_page' => '25',
+        ),
+        'wildcard' => 'all',
+        'wildcard_substitution' => 'All',
+        'title' => '%2',
+        'default_argument_type' => 'fixed',
+        'default_argument' => '',
+        'validate_type' => 'none',
+        'validate_fail' => 'not found',
+        'id' => 'province',
+        'table' => 'location',
+        'field' => 'province',
+        'relationship' => 'none',
+        'default_options_div_prefix' => '',
+        'default_argument_fixed' => '',
+        'default_argument_php' => '',
+        'validate_argument_node_type' => array(
+          'page' => 0,
+          'story' => 0,
+        ),
+        'validate_argument_node_access' => 0,
+        'validate_argument_nid_type' => 'nid',
+        'validate_argument_php' => '',
+      ),
+      'city' => array(
+        'default_action' => 'summary asc',
+        'style_plugin' => 'default_summary',
+        'style_options' => array(
+          'count' => 1,
+          'override' => 0,
+          'items_per_page' => '25',
+        ),
+        'wildcard' => 'all',
+        'wildcard_substitution' => 'All',
+        'title' => '%3',
+        'default_argument_type' => 'fixed',
+        'default_argument' => '',
+        'validate_type' => 'none',
+        'validate_fail' => 'not found',
+        'glossary' => 1,
+        'limit' => '1',
+        'case' => 'none',
+        'path_case' => 'none',
+        'transform_dash' => 0,
+        'id' => 'city',
+        'table' => 'location',
+        'field' => 'city',
+        'relationship' => 'none',
+        'default_options_div_prefix' => '',
+        'default_argument_fixed' => '',
+        'default_argument_php' => '',
+        'validate_argument_node_type' => array(
+          'page' => 0,
+          'story' => 0,
+        ),
+        'validate_argument_node_access' => 0,
+        'validate_argument_nid_type' => 'nid',
+        'validate_argument_php' => '',
+      ),
+    )
+  );
+  $handler->override_option(
+    'filters',
+    array(
+      'status_extra' => array(
+        'operator' => '=',
+        'value' => '',
+        'group' => '0',
+        'exposed' => FALSE,
+        'expose' => array(
+          'operator' => FALSE,
+          'label' => '',
+        ),
+        'id' => 'status_extra',
+        'table' => 'node',
+        'field' => 'status_extra',
+        'relationship' => 'none',
+      ),
+      'lid' => array(
+        'operator' => 'not empty',
+        'value' => array(
+          'value' => '',
+          'min' => '',
+          'max' => '',
+        ),
+        'group' => '0',
+        'exposed' => FALSE,
+        'expose' => array(
+          'operator' => FALSE,
+          'label' => '',
+        ),
+        'id' => 'lid',
+        'table' => 'location',
+        'field' => 'lid',
+        'relationship' => 'none',
+      ),
+    )
+  );
+  $handler->override_option(
+    'access',
+    array(
+      'type' => 'perm',
+      'perm' => 'view location directory',
+    )
+  );
+  $handler->override_option('style_plugin', 'table');
+  $handler->override_option(
+    'style_options',
+    array(
+      'grouping' => '',
+      'override' => 1,
+      'sticky' => 0,
+      'order' => 'asc',
+      'columns' => array(
+        'title' => 'title',
+        'street' => 'street',
+        'city' => 'city',
+        'province' => 'province',
+        'postal_code' => 'postal_code',
+        'country' => 'country',
+      ),
+      'info' => array(
+        'title' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'street' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'city' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'province' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'postal_code' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'country' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+      ),
+      'default' => '-1',
+    )
+  );
   $handler = $view->new_display('page', 'Page', 'page_1');
   $handler->override_option('title', 'Locations');
   $handler->override_option('path', 'location/directory');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Locations',
-    'weight' => '0',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'weight' => 0,
-  ));
+  $handler->override_option(
+    'menu',
+    array(
+      'type' => 'normal',
+      'title' => 'Locations',
+      'weight' => '0',
+    )
+  );
+  $handler->override_option(
+    'tab_options',
+    array(
+      'type' => 'none',
+      'title' => '',
+      'weight' => 0,
+    )
+  );
   $views[$view->name] = $view;
 
 
@@ -450,170 +489,188 @@ function location_views_default_views() {
   $view->api_version = 2;
   $view->disabled = TRUE;
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
-    'name' => array(
-      'label' => 'Name',
-      'link_to_user' => 1,
-      'exclude' => 0,
-      'id' => 'name',
-      'table' => 'users',
-      'field' => 'name',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'street' => array(
-      'label' => 'Street',
-      'style' => 'both',
-      'exclude' => 0,
-      'id' => 'street',
-      'table' => 'location',
-      'field' => 'street',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'city' => array(
-      'label' => 'City',
-      'exclude' => 0,
-      'id' => 'city',
-      'table' => 'location',
-      'field' => 'city',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'province' => array(
-      'label' => 'Province',
-      'style' => 'name',
-      'exclude' => 0,
-      'id' => 'province',
-      'table' => 'location',
-      'field' => 'province',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'postal_code' => array(
-      'label' => 'Postal Code',
-      'exclude' => 0,
-      'id' => 'postal_code',
-      'table' => 'location',
-      'field' => 'postal_code',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-    'country' => array(
-      'label' => 'Country',
-      'style' => 'name',
-      'exclude' => 0,
-      'id' => 'country',
-      'table' => 'location',
-      'field' => 'country',
-      'override' => array(
-        'button' => 'Override',
-      ),
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'status' => array(
-      'operator' => '=',
-      'value' => 1,
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'status',
-      'table' => 'users',
-      'field' => 'status',
-      'relationship' => 'none',
-    ),
-    'lid' => array(
-      'operator' => 'not empty',
-      'value' => array(
-        'value' => '',
-        'min' => '',
-        'max' => '',
-      ),
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'lid',
-      'table' => 'location',
-      'field' => 'lid',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'view user location table',
-  ));
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'columns' => array(
-      'name' => 'name',
-      'street' => 'street',
-      'city' => 'city',
-      'province' => 'province',
-      'postal_code' => 'postal_code',
-      'country' => 'country',
-    ),
-    'info' => array(
+  $handler->override_option(
+    'fields',
+    array(
       'name' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Name',
+        'link_to_user' => 1,
+        'exclude' => 0,
+        'id' => 'name',
+        'table' => 'users',
+        'field' => 'name',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
       ),
       'street' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Street',
+        'style' => 'both',
+        'exclude' => 0,
+        'id' => 'street',
+        'table' => 'location',
+        'field' => 'street',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
       ),
       'city' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'City',
+        'exclude' => 0,
+        'id' => 'city',
+        'table' => 'location',
+        'field' => 'city',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
       ),
       'province' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Province',
+        'style' => 'name',
+        'exclude' => 0,
+        'id' => 'province',
+        'table' => 'location',
+        'field' => 'province',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
       ),
       'postal_code' => array(
-        'sortable' => 1,
-        'separator' => '',
+        'label' => 'Postal Code',
+        'exclude' => 0,
+        'id' => 'postal_code',
+        'table' => 'location',
+        'field' => 'postal_code',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
       ),
       'country' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-    ),
-    'default' => '-1',
-  ));
+        'label' => 'Country',
+        'style' => 'name',
+        'exclude' => 0,
+        'id' => 'country',
+        'table' => 'location',
+        'field' => 'country',
+        'override' => array(
+          'button' => 'Override',
+        ),
+        'relationship' => 'none',
+      ),
+    )
+  );
+  $handler->override_option(
+    'filters',
+    array(
+      'status' => array(
+        'operator' => '=',
+        'value' => 1,
+        'group' => '0',
+        'exposed' => FALSE,
+        'expose' => array(
+          'operator' => FALSE,
+          'label' => '',
+        ),
+        'id' => 'status',
+        'table' => 'users',
+        'field' => 'status',
+        'relationship' => 'none',
+      ),
+      'lid' => array(
+        'operator' => 'not empty',
+        'value' => array(
+          'value' => '',
+          'min' => '',
+          'max' => '',
+        ),
+        'group' => '0',
+        'exposed' => FALSE,
+        'expose' => array(
+          'operator' => FALSE,
+          'label' => '',
+        ),
+        'id' => 'lid',
+        'table' => 'location',
+        'field' => 'lid',
+        'relationship' => 'none',
+      ),
+    )
+  );
+  $handler->override_option(
+    'access',
+    array(
+      'type' => 'perm',
+      'perm' => 'view user location table',
+    )
+  );
+  $handler->override_option('style_plugin', 'table');
+  $handler->override_option(
+    'style_options',
+    array(
+      'grouping' => '',
+      'override' => 1,
+      'sticky' => 0,
+      'order' => 'asc',
+      'columns' => array(
+        'name' => 'name',
+        'street' => 'street',
+        'city' => 'city',
+        'province' => 'province',
+        'postal_code' => 'postal_code',
+        'country' => 'country',
+      ),
+      'info' => array(
+        'name' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'street' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'city' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'province' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'postal_code' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+        'country' => array(
+          'sortable' => 1,
+          'separator' => '',
+        ),
+      ),
+      'default' => '-1',
+    )
+  );
   $handler = $view->new_display('page', 'Page', 'page_1');
   $handler->override_option('path', 'location/users');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'User location table',
-    'weight' => '0',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'weight' => 0,
-  ));
+  $handler->override_option(
+    'menu',
+    array(
+      'type' => 'normal',
+      'title' => 'User location table',
+      'weight' => '0',
+    )
+  );
+  $handler->override_option(
+    'tab_options',
+    array(
+      'type' => 'none',
+      'title' => '',
+      'weight' => 0,
+    )
+  );
   $views[$view->name] = $view;
 
 
diff --git a/location_node.module b/location_node.module
index f757e10..19c7090 100644
--- a/location_node.module
+++ b/location_node.module
@@ -109,10 +109,13 @@ function location_node_node_view($node, $view_mode) {
   else {
     if (variable_get('location_display_location', 1) && !empty($node->locations)) {
       if (isset($settings['display']['teaser']) && isset($settings['display']['full'])) {
-        if (($view_mode == 'teaser' && $settings['display']['teaser']) || (in_array($view_mode, array(
-          'full',
-          'search_index'
-        )) && $settings['display']['full'])
+        if (($view_mode == 'teaser' && $settings['display']['teaser']) || (in_array(
+              $view_mode,
+              array(
+                'full',
+                'search_index'
+              )
+            ) && $settings['display']['full'])
         ) {
           $node->content['locations'] = location_display($settings, $node->locations);
         }
@@ -213,11 +216,21 @@ function location_node_form_node_type_form_alter(&$form, &$form_state, $form_id)
  */
 function location_node_settings_validate($form, &$form_state) {
   if (!empty($form_state['values']['location_settings']['multiple']['max']) && empty($form_state['values']['location_settings']['multiple']['add'])) {
-    form_error($form['location_settings']['multiple']['add'], t("You must have at least one empty location form enabled if you are going to allow locations to be submitted for nodes of this content type. If you don't intend to allow locations to be submitted for nodes of this content type, set the maximum number of locations allowed for this content type to 0."));
+    form_error(
+      $form['location_settings']['multiple']['add'],
+      t(
+        "You must have at least one empty location form enabled if you are going to allow locations to be submitted for nodes of this content type. If you don't intend to allow locations to be submitted for nodes of this content type, set the maximum number of locations allowed for this content type to 0."
+      )
+    );
   }
   elseif ($form_state['values']['location_settings']['multiple']['max'] > 0) {
     if ($form_state['values']['location_settings']['multiple']['add'] > $form_state['values']['location_settings']['multiple']['max']) {
-      form_error($form['location_settings']['multiple']['add'], t("You can't show more empty location forms than the maximum number of locations allowed for this content type."));
+      form_error(
+        $form['location_settings']['multiple']['add'],
+        t(
+          "You can't show more empty location forms than the maximum number of locations allowed for this content type."
+        )
+      );
     }
   }
 }
@@ -230,8 +243,14 @@ function _location_node_type_save_submit($form, &$form_state) {
 
   // @@@ Backwards compatibility variables.
   // There are a few places in contrib where these variables are checked.
-  variable_set('location_maxnum_' . $form_state['values']['type'], $form_state['values']['location_settings']['multiple']['max']);
-  variable_set('location_defaultnum_' . $form_state['values']['type'], $form_state['values']['location_settings']['multiple']['add']);
+  variable_set(
+    'location_maxnum_' . $form_state['values']['type'],
+    $form_state['values']['location_settings']['multiple']['max']
+  );
+  variable_set(
+    'location_defaultnum_' . $form_state['values']['type'],
+    $form_state['values']['location_settings']['multiple']['add']
+  );
 
   // Prevent the "normal" submit handler from stomping our variable.
   unset($form_state['values']['location_settings']);
@@ -258,6 +277,7 @@ function location_node_content_extra_fields($type_name) {
       'description' => t('Node Locations module form.'),
       'weight' => $weight,
     );
+
     return $extra;
   }
 }
@@ -299,5 +319,6 @@ function location_node_node_locations_enabled($type) {
   if (!empty($settings) && isset($settings['multiple']['max']) && !empty($settings['multiple']['max'])) {
     return TRUE;
   }
+
   return FALSE;
 }
diff --git a/location_user.module b/location_user.module
index bc59965..80ae227 100644
--- a/location_user.module
+++ b/location_user.module
@@ -98,7 +98,10 @@ function location_user_user_delete($account) {
 function location_user_user_view($account, $view_mode, $langcode) {
   global $user;
 
-  if ((($user->uid == $account->uid) && user_access('view own user location')) || user_access('administer users') || user_access('view all user locations') || user_access('administer user locations')) {
+  if ((($user->uid == $account->uid) && user_access('view own user location')) || user_access(
+      'administer users'
+    ) || user_access('view all user locations') || user_access('administer user locations')
+  ) {
     if (variable_get('location_display_location', 1) && isset($account->locations) && count($account->locations)) {
       $settings = variable_get('location_settings_user', array());
       $account->content['locations'] = location_display($settings, $account->locations);
@@ -115,7 +118,10 @@ function location_user_form_user_profile_form_alter(&$form, &$form_state, $form_
 
   if ($form['#user_category'] == 'account') {
     $account = $form['#user'];
-    if ((($user->uid == $account->uid) && user_access('set own user location')) || user_access('administer user locations')) {
+    if ((($user->uid == $account->uid) && user_access('set own user location')) || user_access(
+        'administer user locations'
+      )
+    ) {
       $settings = variable_get('location_settings_user', array());
       $form['locations'] = location_form($settings, $account->locations);
     }
diff --git a/locations.tpl.php b/locations.tpl.php
index 19d2365..e43099a 100644
--- a/locations.tpl.php
+++ b/locations.tpl.php
@@ -1,6 +1,7 @@
 <?php if (!empty($locations)): ?>
   <div class="location-locations-display">
     <h3 class="location-locations-header"><?php print format_plural(count($locations), 'Location', 'Locations'); ?></h3>
+
     <div class="location-locations-wrapper">
       <?php foreach ($locations as $location): ?>
         <?php print $location; ?>
diff --git a/plugins/contexts/location.inc b/plugins/contexts/location.inc
index 99284af..6f021ed 100644
--- a/plugins/contexts/location.inc
+++ b/plugins/contexts/location.inc
@@ -57,6 +57,7 @@ function location_context_create_location($empty, $data = NULL, $conf = FALSE) {
     $context->data = $data;
     $context->title = $data['city'];
     $context->argument = $data['lid'];
+
     return $context;
   }
 }
@@ -72,6 +73,7 @@ function location_context_location_convert_list() {
   $fields = location_field_names();
   $fields['country_name'] = t('Country name');
   $fields['province_name'] = t('State/Province name');
+
   return $fields;
 }
 
diff --git a/plugins/relationships/location_from_node.inc b/plugins/relationships/location_from_node.inc
index a0bd921..963c541 100644
--- a/plugins/relationships/location_from_node.inc
+++ b/plugins/relationships/location_from_node.inc
@@ -121,7 +121,9 @@ function location_location_from_node_settings_form($form, &$form_state) {
       '#type' => 'select',
       '#options' => $offset_options,
       '#default_value' => isset($conf['location_node_offset']) ? $conf['location_node_offset'] : 0,
-      '#description' => t('If the nodes that will be used for this relationship have multiple locations, select which location you want to use.'),
+      '#description' => t(
+        'If the nodes that will be used for this relationship have multiple locations, select which location you want to use.'
+      ),
       '#process' => array('ctools_dependent_process'),
       '#dependency' => array('radio:relationship[relationship_settings][location_type]' => array('location_node')),
       '#weight' => 4,
@@ -152,7 +154,9 @@ function location_location_from_node_settings_form($form, &$form_state) {
         '#type' => 'select',
         '#options' => $offset_options,
         '#default_value' => isset($conf['location_cck_field_offset']) ? $conf['location_cck_field_offset'] : 0,
-        '#description' => t('If the nodes that will be used for this relationship have multiple locations, select which location you want to use.'),
+        '#description' => t(
+          'If the nodes that will be used for this relationship have multiple locations, select which location you want to use.'
+        ),
         '#process' => array('ctools_dependent_process'),
         '#dependency' => array('radio:relationship[relationship_settings][location_type]' => array('location_cck')),
         '#weight' => 7,
diff --git a/supported/location.au.inc b/supported/location.au.inc
index d55eb93..ca0a25a 100644
--- a/supported/location.au.inc
+++ b/supported/location.au.inc
@@ -24,10 +24,13 @@ function location_latlon_rough_au($location = array()) {
     return NULL;
   }
 
-  $row = db_query("SELECT latitude, longitude FROM {zipcodes} WHERE country = :country AND zip = :zip", array(
-    ':country' => $location['country'],
-    ':zip' => substr(str_pad($location['postal_code'], 4, '0', STR_PAD_LEFT), 0, 4)
-  ))->fetchObject();
+  $row = db_query(
+    "SELECT latitude, longitude FROM {zipcodes} WHERE country = :country AND zip = :zip",
+    array(
+      ':country' => $location['country'],
+      ':zip' => substr(str_pad($location['postal_code'], 4, '0', STR_PAD_LEFT), 0, 4)
+    )
+  )->fetchObject();
 
   if ($row) {
     return array('lat' => $row->latitude, 'lon' => $row->longitude);
@@ -62,10 +65,13 @@ function _location_latlon_postalcode_au($location = array()) {
   }
 
   // Now we pad the thing and query.
-  $row = db_query("SELECT * FROM {zipcodes} where country = :country AND zip = :zip", array(
-    ':country' => $location['country'],
-    ':zip' => str_pad($location['postal_code'], 4, "0", STR_PAD_LEFT)
-  ))->fetchObject();
+  $row = db_query(
+    "SELECT * FROM {zipcodes} where country = :country AND zip = :zip",
+    array(
+      ':country' => $location['country'],
+      ':zip' => str_pad($location['postal_code'], 4, "0", STR_PAD_LEFT)
+    )
+  )->fetchObject();
   if ($row) {
     return array(
       'lat' => $row->latitude,
@@ -123,7 +129,10 @@ function _location_latlon_exact_au_geocoder($location = array()) {
     if (isset($location['postal_code'])) {
       $location_string = $location['street'] . ' ' . $location['postal_code'];
     }
-    elseif (isset($location['city']) && isset($location['province']) && trim($location['city']) != '' && trim($location['province'])) {
+    elseif (isset($location['city']) && isset($location['province']) && trim($location['city']) != '' && trim(
+        $location['province']
+      )
+    ) {
       $location_string = $location['street'] . ', ' . $location['city'] . ', ' . $location['province'];
     }
     else { // else geocoder.us won't do bidness with you!
@@ -136,9 +145,13 @@ function _location_latlon_exact_au_geocoder($location = array()) {
 
   $result = xmlrpc('http://rpc.geocoder.us/service/xmlrpc', array('geocode' => array($location_string)));
 
-  if (is_array($result) && is_array($result[0]) && isset($result[0]['lat']) && is_numeric($result[0]['lat']) && isset($result[0]['long']) && is_numeric($result[0]['long'])) {
+  if (is_array($result) && is_array($result[0]) && isset($result[0]['lat']) && is_numeric(
+      $result[0]['lat']
+    ) && isset($result[0]['long']) && is_numeric($result[0]['long'])
+  ) {
     return array('lat' => $result[0]['lat'], 'lon' => $result[0]['long']);
   }
+
   return NULL;
 }
 
@@ -151,6 +164,7 @@ function location_map_link_au_yahoo($location = array()) {
     $get_query .= 'csz=' . _location_au_yahoo_csz_get_field($location) . '&amp;';
   }
   $get_query .= 'country=' . urlencode($location['country']);
+
   return ('http://maps.yahoo.com/maps_result' . $get_query);
 }
 
@@ -260,17 +274,23 @@ function location_geocode_au_yahoo_settings() {
     '#size' => 64,
     '#maxlength' => 128,
     '#default_value' => variable_get('location_geocode_au_yahoo_appid', 'YahooDemo'),
-    '#description' => t('Unless you are using this site to test and develop, you will need to obtain a Yahoo! Web Services Application ID from the %network_link.  If you are using for development and testing purposes, you can use \'YahooDemo\' as your AppID.  When getting an Application ID from Yahoo!, be sure to review the %usage_policy.', array(
-      '%network_link' => '<a href="http://api.search.yahoo.com/webservices/register_application">Yahoo! Developer Network</a>',
-      '%usage_policy' => '<a href="http://developer.yahoo.com/usagePolicy/index.html">usage policy</a>'
-    ))
+    '#description' => t(
+      'Unless you are using this site to test and develop, you will need to obtain a Yahoo! Web Services Application ID from the %network_link.  If you are using for development and testing purposes, you can use \'YahooDemo\' as your AppID.  When getting an Application ID from Yahoo!, be sure to review the %usage_policy.',
+      array(
+        '%network_link' => '<a href="http://api.search.yahoo.com/webservices/register_application">Yahoo! Developer Network</a>',
+        '%usage_policy' => '<a href="http://developer.yahoo.com/usagePolicy/index.html">usage policy</a>'
+      )
+    )
   );
 
   return $form;
 }
 
 function location_geocode_au_yahoo($location = array()) {
-  $service_url = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=" . variable_get('location_geocode_au_yahoo_appid', "YahooDemo") . "&location=";
+  $service_url = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=" . variable_get(
+      'location_geocode_au_yahoo_appid',
+      "YahooDemo"
+    ) . "&location=";
 
   $address = location_address2singleline($location);
 
@@ -442,6 +462,7 @@ function _location_au_yahoo_csz_get_field($location) {
       return urlencode($location['state']);
     }
   }
+
   return '';
 }
 
diff --git a/supported/location.ca.inc b/supported/location.ca.inc
index 9508c7b..66f2231 100644
--- a/supported/location.ca.inc
+++ b/supported/location.ca.inc
@@ -59,10 +59,13 @@ function location_latlon_rough_ca($location = array()) {
     return NULL;
   }
 
-  $row = db_query("SELECT latitude, longitude FROM {zipcodes} WHERE country = :country AND zip = :zip", array(
-    ':country' => $location['country'],
-    ':zip' => $location['postal_code']
-  ))->fetchObject();
+  $row = db_query(
+    "SELECT latitude, longitude FROM {zipcodes} WHERE country = :country AND zip = :zip",
+    array(
+      ':country' => $location['country'],
+      ':zip' => $location['postal_code']
+    )
+  )->fetchObject();
 
   if ($row) {
     return array('lat' => $row->latitude, 'lon' => $row->longitude);
@@ -94,10 +97,13 @@ function location_latlon_rough_ca($location = array()) {
  */
 function location_get_postalcode_data_ca($location = array()) {
   // Now we pad the thing and query.
-  $row = db_query("SELECT * FROM {zipcodes} where country = :country AND zip = :zip", array(
-    ':country' => $location['country'],
-    ':zip' => $location['postal_code']
-  ))->fetchObject();
+  $row = db_query(
+    "SELECT * FROM {zipcodes} where country = :country AND zip = :zip",
+    array(
+      ':country' => $location['country'],
+      ':zip' => $location['postal_code']
+    )
+  )->fetchObject();
   if ($row) {
     return array(
       'lat' => $row->latitude,
@@ -136,6 +142,7 @@ function location_map_link_ca_yahoo($location = array()) {
     $get_query .= 'csz=' . _location_ca_yahoo_csz_get_field($location) . '&amp;';
   }
   $get_query .= 'country=' . urlencode($location['country']);
+
   return ('http://ca.maps.yahoo.com/maps_result' . $get_query);
 }
 
@@ -334,6 +341,7 @@ function _location_ca_yahoo_csz_get_field($location) {
       return urlencode($location['province']);
     }
   }
+
   return '';
 }
 
@@ -357,10 +365,13 @@ function location_geocode_ca_geocoder_settings() {
     '#size' => 64,
     '#maxlength' => 128,
     '#default_value' => variable_get('location_geocode_ca_geocoder_apikey', ''),
-    '#description' => t('In order to use the Geocoder.ca API geocoding web-service, if you are a commercial entity or wish to use the service without attribution, you will need a Geocoder API Key.  You can obtain one at the !sign_up_link for the !geocoder_api.', array(
-      '!sign_up_link' => '<a href="http://geocoder.ca/?register=1">sign-up page</a>',
-      '!geocoder_api' => '<a href="http://geocoder.ca/?premium_api=1">Geocoder API</a>'
-    ))
+    '#description' => t(
+      'In order to use the Geocoder.ca API geocoding web-service, if you are a commercial entity or wish to use the service without attribution, you will need a Geocoder API Key.  You can obtain one at the !sign_up_link for the !geocoder_api.',
+      array(
+        '!sign_up_link' => '<a href="http://geocoder.ca/?register=1">sign-up page</a>',
+        '!geocoder_api' => '<a href="http://geocoder.ca/?premium_api=1">Geocoder API</a>'
+      )
+    )
   );
 
   return $form;
@@ -410,6 +421,7 @@ function location_geocode_ca_geocoder($location = array()) {
 
     if (preg_match('/<longt>(.*)<\/longt>/', $http_reply->data, $lon_match)) {
       $latlon['lon'] = $lon_match[1];
+
       return $latlon;
     }
     else {
diff --git a/supported/location.ch.inc b/supported/location.ch.inc
index 49219ae..cb663b2 100644
--- a/supported/location.ch.inc
+++ b/supported/location.ch.inc
@@ -74,6 +74,7 @@ function location_map_link_ch_search($location = array()) {
 
   if ($location['postal_code'] || $location['city'] || $location['street']) {
     $query_param = $location['postal_code'] . '-' . $location['city'] . '/' . $location['street'];
+
     return 'http://map.search.ch/' . $query_param;
   }
   else {
@@ -97,7 +98,10 @@ function _location_driving_directions_link_ch_search($location_a, $location_b) {
       $query_params_b[] = $location_b[$field];
     }
   }
-  return 'http://route.search.ch/?route=' . urlencode(implode(' ', $query_params_a) . ' to ' . implode(' ', $query_params_b));
+
+  return 'http://route.search.ch/?route=' . urlencode(
+    implode(' ', $query_params_a) . ' to ' . implode(' ', $query_params_b)
+  );
 }
 
 /**
diff --git a/supported/location.de.inc b/supported/location.de.inc
index c4c40fb..7384bff 100644
--- a/supported/location.de.inc
+++ b/supported/location.de.inc
@@ -41,6 +41,7 @@ function location_map_link_de($location = array(), $hide = array()) {
   if ($link = _location_map_link_de_suchen($location)) {
     $map_links['suchen'] = $link;
   }
+
   return $map_links;
 }
 
@@ -61,6 +62,7 @@ function _location_map_link_de_suchen($location = array()) {
 //    $query_parts[] = $location['number'];
 //  }
   $get_query .= urlencode(implode(', ', $query_parts));
+
   return ('http://www.suchen.de/lokalmap' . $get_query);
 }
 
@@ -220,6 +222,7 @@ function theme_location_de($location = array(), $hide = array()) {
     $output .= '</div></div>';
 
   }
+
   return $output;
 }
 
@@ -248,10 +251,13 @@ function location_get_postalcode_data_de($location = array()) {
   }
 
   // Now we pad the thing and query.
-  $row = db_query("SELECT * FROM {zipcodes} where country = :country AND zip = :zip", array(
-    ':country' => $location['country'],
-    ':zip' => str_pad($location['postal_code'], 5, "0", STR_PAD_LEFT)
-  ))->fetchObject();
+  $row = db_query(
+    "SELECT * FROM {zipcodes} where country = :country AND zip = :zip",
+    array(
+      ':country' => $location['country'],
+      ':zip' => str_pad($location['postal_code'], 5, "0", STR_PAD_LEFT)
+    )
+  )->fetchObject();
   if ($row) {
     return array(
       'lat' => $row->latitude,
diff --git a/supported/location.dk.inc b/supported/location.dk.inc
index a1838c3..b12182c 100644
--- a/supported/location.dk.inc
+++ b/supported/location.dk.inc
@@ -45,12 +45,15 @@ function location_map_link_dk_findvej($location = array()) {
     return url('http://findvej.dk/' . $location['street'] . ',' . $location['city']);
   }
   elseif (location_has_coordinates($location)) {
-    return url('http://findvej.dk/', array(
-      'query' => array(
-        'latitude' => $location['latitude'],
-        'longitude' => $location['longitude'],
+    return url(
+      'http://findvej.dk/',
+      array(
+        'query' => array(
+          'latitude' => $location['latitude'],
+          'longitude' => $location['longitude'],
+        )
       )
-    ));
+    );
   }
   else {
     return NULL;
diff --git a/supported/location.md.inc b/supported/location.md.inc
index 56db039..7a13c76 100644
--- a/supported/location.md.inc
+++ b/supported/location.md.inc
@@ -4,7 +4,7 @@
 
 function location_province_list_md() {
   return array(
-    'C'  => "Chișinău",
+    'C' => "Chișinău",
     'AN' => "Anenii Noi",
     'BS' => "Basarabeasca",
     'BE' => "Bender",
diff --git a/supported/location.no.inc b/supported/location.no.inc
index 2352a58..07c33fd 100644
--- a/supported/location.no.inc
+++ b/supported/location.no.inc
@@ -31,10 +31,13 @@ function _location_latlon_rough_no($location = array()) {
     return NULL;
   }
 
-  $row = db_query("SELECT latitude, longitude FROM {zipcodes} WHERE country = :country AND zip = :zip", array(
-    ':country' => $location['country'],
-    ':zip' => substr(str_pad($location['postal_code'], 5, '0', STR_PAD_LEFT), 0, 5)
-  ))->fetchObject();
+  $row = db_query(
+    "SELECT latitude, longitude FROM {zipcodes} WHERE country = :country AND zip = :zip",
+    array(
+      ':country' => $location['country'],
+      ':zip' => substr(str_pad($location['postal_code'], 5, '0', STR_PAD_LEFT), 0, 5)
+    )
+  )->fetchObject();
 
   if ($row) {
     return array('lat' => $row->latitude, 'lon' => $row->longitude);
@@ -67,10 +70,13 @@ function _location_latlon_rough_no($location = array()) {
 function _location_latlon_postalcode_no($location = array()) {
   // Now we pad the thing and query.
   #$res = db_query("SELECT * FROM {zipcodes} where country = '%s' AND zip = '%s'", $location['country'], str_pad($location['postal_code'], 4, "0", STR_PAD_LEFT));
-  $row = db_query("SELECT * FROM {zipcodes} where country = :country AND zip = :zip", array(
-    ':country' => $location['country'],
-    ':zip' => $location['postal_code']
-  ))->fetchObject();
+  $row = db_query(
+    "SELECT * FROM {zipcodes} where country = :country AND zip = :zip",
+    array(
+      ':country' => $location['country'],
+      ':zip' => $location['postal_code']
+    )
+  )->fetchObject();
   if ($row) {
     return array(
       'lat' => $row->latitude,
diff --git a/supported/location.nz.inc b/supported/location.nz.inc
index 40051db..096ff48 100644
--- a/supported/location.nz.inc
+++ b/supported/location.nz.inc
@@ -97,7 +97,11 @@ function location_latlon_rough_nz($location = array()) {
     return NULL;
   }
 
-  $result = db_query("SELECT latitude, longitude FROM {zipcodes} WHERE country = '%s' AND zip = '%s'", $location['country'], substr(str_pad($location['postal_code'], 4, '0', STR_PAD_LEFT), 0, 4));
+  $result = db_query(
+    "SELECT latitude, longitude FROM {zipcodes} WHERE country = '%s' AND zip = '%s'",
+    $location['country'],
+    substr(str_pad($location['postal_code'], 4, '0', STR_PAD_LEFT), 0, 4)
+  );
 
   if ($row = $result->fetch()) {
     return array('lat' => $row->latitude, 'lon' => $row->longitude);
@@ -125,7 +129,11 @@ function location_latlon_rough_nz($location = array()) {
  *
  */
 function _location_latlon_postalcode_nz($location = array()) {
-  $res = db_query("SELECT * FROM {zipcodes} where country = '%s' AND zip = '%s'", $location['country'], str_pad($location['postal_code'], 4, "0", STR_PAD_LEFT));
+  $res = db_query(
+    "SELECT * FROM {zipcodes} where country = '%s' AND zip = '%s'",
+    $location['country'],
+    str_pad($location['postal_code'], 4, "0", STR_PAD_LEFT)
+  );
   if ($row = $res->fetch()) {
     return array(
       'lat' => $row->latitude,
@@ -181,7 +189,10 @@ function _location_latlon_exact_nz_geocoder($location = array()) {
     if (isset($location['postal_code'])) {
       $location_string = $location['street'] . ' ' . $location['postal_code'];
     }
-    elseif (isset($location['city']) && isset($location['province']) && trim($location['city']) != '' && trim($location['province'])) {
+    elseif (isset($location['city']) && isset($location['province']) && trim($location['city']) != '' && trim(
+        $location['province']
+      )
+    ) {
       $location_string = $location['street'] . ', ' . $location['city'] . ', ' . $location['province'];
     }
     else { // else geocoder.us won't do bidness with you!
@@ -194,9 +205,13 @@ function _location_latlon_exact_nz_geocoder($location = array()) {
 
   $result = xmlrpc('http://rpc.geocoder.us/service/xmlrpc', 'geocode', $location_string);
 
-  if (is_array($result) && is_array($result[0]) && isset($result[0]['lat']) && is_numeric($result[0]['lat']) && isset($result[0]['long']) && is_numeric($result[0]['long'])) {
+  if (is_array($result) && is_array($result[0]) && isset($result[0]['lat']) && is_numeric(
+      $result[0]['lat']
+    ) && isset($result[0]['long']) && is_numeric($result[0]['long'])
+  ) {
     return array('lat' => $result[0]['lat'], 'lon' => $result[0]['long']);
   }
+
   return NULL;
 }
 
@@ -215,6 +230,7 @@ function location_map_link_nz_yahoo($location = array()) {
     $get_query .= 'csz=' . _location_nz_yahoo_csz_get_field($location) . '&amp;';
   }
   $get_query .= 'country=' . urlencode($location['country']);
+
   return ('http://maps.yahoo.com/maps_result' . $get_query);
 }
 
@@ -336,17 +352,23 @@ function location_geocode_nz_yahoo_settings() {
     '#size' => 64,
     '#maxlength' => 128,
     '#default_value' => variable_get('location_geocode_nz_yahoo_appid', 'YahooDemo'),
-    '#description' => t('Unless you are using this site to test and develop, you will need to obtain a Yahoo! Web Services Application ID from the %network_link.  If you are using for development and testing purposes, you can use \'YahooDemo\' as your AppID.  When getting an Application ID from Yahoo!, be sure to review the %usage_policy.', array(
-      '%network_link' => '<a href="http://api.search.yahoo.com/webservices/register_application">Yahoo! Developer Network</a>',
-      '%usage_policy' => '<a href="http://developer.yahoo.com/usagePolicy/index.html">usage policy</a>'
-    ))
+    '#description' => t(
+      'Unless you are using this site to test and develop, you will need to obtain a Yahoo! Web Services Application ID from the %network_link.  If you are using for development and testing purposes, you can use \'YahooDemo\' as your AppID.  When getting an Application ID from Yahoo!, be sure to review the %usage_policy.',
+      array(
+        '%network_link' => '<a href="http://api.search.yahoo.com/webservices/register_application">Yahoo! Developer Network</a>',
+        '%usage_policy' => '<a href="http://developer.yahoo.com/usagePolicy/index.html">usage policy</a>'
+      )
+    )
   );
 
   return $form;
 }
 
 function location_geocode_nz_yahoo($location = array()) {
-  $service_url = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=" . variable_get('location_geocode_nz_yahoo_appid', "YahooDemo") . "&location=";
+  $service_url = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=" . variable_get(
+      'location_geocode_nz_yahoo_appid',
+      "YahooDemo"
+    ) . "&location=";
 
   $address = location_address2singleline($location);
 
@@ -515,6 +537,7 @@ function _location_nz_yahoo_csz_get_field($location) {
       return urlencode($location['state']);
     }
   }
+
   return '';
 }
 
diff --git a/supported/location.us.inc b/supported/location.us.inc
index d292987..e9de2e7 100644
--- a/supported/location.us.inc
+++ b/supported/location.us.inc
@@ -22,10 +22,13 @@ function location_latlon_rough_us($location = array()) {
     return NULL;
   }
 
-  $row = db_query("SELECT latitude, longitude FROM {zipcodes} where country = :country AND zip = :zip", array(
-    ':country' => $location['country'],
-    ':zip' => substr(str_pad($location['postal_code'], 5, '0', STR_PAD_LEFT), 0, 5)
-  ))->fetchObject();
+  $row = db_query(
+    "SELECT latitude, longitude FROM {zipcodes} where country = :country AND zip = :zip",
+    array(
+      ':country' => $location['country'],
+      ':zip' => substr(str_pad($location['postal_code'], 5, '0', STR_PAD_LEFT), 0, 5)
+    )
+  )->fetchObject();
 
   if ($row) {
     return array('lat' => $row->latitude, 'lon' => $row->longitude);
@@ -60,10 +63,13 @@ function location_get_postalcode_data_us($location = array()) {
   }
 
   // Now we pad the thing and query.
-  $row = db_query("SELECT * FROM {zipcodes} where country = :country AND zip = :zip", array(
-    ':country' => $location['country'],
-    ':zip' => str_pad($location['postal_code'], 5, "0", STR_PAD_LEFT)
-  ))->fetchObject();
+  $row = db_query(
+    "SELECT * FROM {zipcodes} where country = :country AND zip = :zip",
+    array(
+      ':country' => $location['country'],
+      ':zip' => str_pad($location['postal_code'], 5, "0", STR_PAD_LEFT)
+    )
+  )->fetchObject();
   if ($row) {
     return array(
       'lat' => $row->latitude,
@@ -122,7 +128,10 @@ function _location_latlon_exact_us_geocoder($location = array()) {
     if (isset($location['postal_code'])) {
       $location_string = $location['street'] . ' ' . $location['postal_code'];
     }
-    elseif (isset($location['city']) && isset($location['province']) && trim($location['city']) != '' && trim($location['province'])) {
+    elseif (isset($location['city']) && isset($location['province']) && trim($location['city']) != '' && trim(
+        $location['province']
+      )
+    ) {
       $location_string = $location['street'] . ', ' . $location['city'] . ', ' . $location['province'];
     }
     else { // else geocoder.us won't do bidness with you!
@@ -135,9 +144,13 @@ function _location_latlon_exact_us_geocoder($location = array()) {
 
   $result = xmlrpc('http://rpc.geocoder.us/service/xmlrpc', array('geocode' => array($location_string)));
 
-  if (is_array($result) && is_array($result[0]) && isset($result[0]['lat']) && is_numeric($result[0]['lat']) && isset($result[0]['long']) && is_numeric($result[0]['long'])) {
+  if (is_array($result) && is_array($result[0]) && isset($result[0]['lat']) && is_numeric(
+      $result[0]['lat']
+    ) && isset($result[0]['long']) && is_numeric($result[0]['long'])
+  ) {
     return array('lat' => $result[0]['lat'], 'lon' => $result[0]['long']);
   }
+
   return NULL;
 }
 
@@ -151,6 +164,7 @@ function location_map_link_us_yahoo($location = array()) {
     $get_query .= 'csz=' . _location_us_yahoo_csz_get_field($location) . '&amp;';
   }
   $get_query .= 'country=' . urlencode($location['country']);
+
   return ('http://maps.yahoo.com/maps_result' . $get_query);
 }
 
@@ -272,17 +286,23 @@ function location_geocode_us_yahoo_settings() {
     '#size' => 64,
     '#maxlength' => 128,
     '#default_value' => variable_get('location_geocode_us_yahoo_appid', 'YahooDemo'),
-    '#description' => t('Unless you are using this site to test and develop, you will need to obtain a Yahoo! Web Services Application ID from the %network_link.  If you are using for development and testing purposes, you can use \'YahooDemo\' as your AppID.  When getting an Application ID from Yahoo!, be sure to review the %usage_policy.', array(
-      '%network_link' => '<a href="http://api.search.yahoo.com/webservices/register_application">Yahoo! Developer Network</a>',
-      '%usage_policy' => '<a href="http://developer.yahoo.com/usagePolicy/index.html">usage policy</a>'
-    ))
+    '#description' => t(
+      'Unless you are using this site to test and develop, you will need to obtain a Yahoo! Web Services Application ID from the %network_link.  If you are using for development and testing purposes, you can use \'YahooDemo\' as your AppID.  When getting an Application ID from Yahoo!, be sure to review the %usage_policy.',
+      array(
+        '%network_link' => '<a href="http://api.search.yahoo.com/webservices/register_application">Yahoo! Developer Network</a>',
+        '%usage_policy' => '<a href="http://developer.yahoo.com/usagePolicy/index.html">usage policy</a>'
+      )
+    )
   );
 
   return $form;
 }
 
 function location_geocode_us_yahoo($location = array()) {
-  $service_url = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=" . variable_get('location_geocode_us_yahoo_appid', "YahooDemo") . "&location=";
+  $service_url = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=" . variable_get(
+      'location_geocode_us_yahoo_appid',
+      "YahooDemo"
+    ) . "&location=";
 
   $address = location_address2singleline($location);
 
@@ -451,6 +471,7 @@ function _location_us_yahoo_csz_get_field($location) {
       return urlencode($location['province']);
     }
   }
+
   return '';
 }
 
diff --git a/tests/cow.test b/tests/cow.test
index e82a3d7..0bf7185 100644
--- a/tests/cow.test
+++ b/tests/cow.test
@@ -44,15 +44,17 @@ class CowInstanceTest extends LocationTestCase {
 
     $location1_name = $this->randomName();
 
-    $node = $this->drupalCreateNode(array(
-      'type' => $location_type,
-      'locations' => array(
-        0 => array(
-          'name' => $location1_name,
-          'location_settings' => $settings,
+    $node = $this->drupalCreateNode(
+      array(
+        'type' => $location_type,
+        'locations' => array(
+          0 => array(
+            'name' => $location1_name,
+            'location_settings' => $settings,
+          ),
         ),
-      ),
-    ));
+      )
+    );
 
     // Reload the node.
     $node2 = node_load($node->nid, NULL, TRUE);
@@ -66,18 +68,20 @@ class CowInstanceTest extends LocationTestCase {
 
     $location1_name = $this->randomName();
 
-    $node = $this->drupalCreateNode(array(
-      'type' => $location_type,
-      'locations' => array(
-        0 => array(
-          'locpick' => array(
-            'user_latitude' => '44.25',
-            'user_longitude' => '-10.25',
+    $node = $this->drupalCreateNode(
+      array(
+        'type' => $location_type,
+        'locations' => array(
+          0 => array(
+            'locpick' => array(
+              'user_latitude' => '44.25',
+              'user_longitude' => '-10.25',
+            ),
+            'location_settings' => $settings,
           ),
-          'location_settings' => $settings,
         ),
-      ),
-    ));
+      )
+    );
 
     // Reload the node.
     $node2 = node_load($node->nid, NULL, TRUE);
@@ -93,23 +97,25 @@ class CowInstanceTest extends LocationTestCase {
     $location2_name = $this->randomName();
     $location3_name = $this->randomName();
 
-    $node = $this->drupalCreateNode(array(
-      'type' => $location_type,
-      'locations' => array(
-        0 => array(
-          'name' => $location1_name,
-          'location_settings' => $settings,
-        ),
-        1 => array(
-          'name' => $location2_name,
-          'location_settings' => $settings,
-        ),
-        2 => array(
-          'name' => $location3_name,
-          'location_settings' => $settings,
+    $node = $this->drupalCreateNode(
+      array(
+        'type' => $location_type,
+        'locations' => array(
+          0 => array(
+            'name' => $location1_name,
+            'location_settings' => $settings,
+          ),
+          1 => array(
+            'name' => $location2_name,
+            'location_settings' => $settings,
+          ),
+          2 => array(
+            'name' => $location3_name,
+            'location_settings' => $settings,
+          ),
         ),
-      ),
-    ));
+      )
+    );
 
     // Reload the node.
     $node2 = node_load($node->nid, NULL, TRUE);
@@ -117,9 +123,21 @@ class CowInstanceTest extends LocationTestCase {
     $this->assertEqual($location1_name, $node2->locations[0]['name'], t('Testing multi location 1/3'));
     $this->assertEqual($location2_name, $node2->locations[1]['name'], t('Testing multi location 2/3'));
     $this->assertEqual($location3_name, $node2->locations[2]['name'], t('Testing multi location 3/3'));
-    $this->assertNotEqual($node2->locations[0]['lid'], $node2->locations[1]['lid'], t('Ensuring location id uniqueness'));
-    $this->assertNotEqual($node2->locations[1]['lid'], $node2->locations[2]['lid'], t('Ensuring location id uniqueness'));
-    $this->assertNotEqual($node2->locations[2]['lid'], $node2->locations[0]['lid'], t('Ensuring location id uniqueness'));
+    $this->assertNotEqual(
+      $node2->locations[0]['lid'],
+      $node2->locations[1]['lid'],
+      t('Ensuring location id uniqueness')
+    );
+    $this->assertNotEqual(
+      $node2->locations[1]['lid'],
+      $node2->locations[2]['lid'],
+      t('Ensuring location id uniqueness')
+    );
+    $this->assertNotEqual(
+      $node2->locations[2]['lid'],
+      $node2->locations[0]['lid'],
+      t('Ensuring location id uniqueness')
+    );
   }
 
   function testSharedLocation() {
@@ -128,15 +146,17 @@ class CowInstanceTest extends LocationTestCase {
 
     $location1_name = $this->randomName();
 
-    $node = $this->drupalCreateNode(array(
-      'type' => $location_type,
-      'locations' => array(
-        0 => array(
-          'name' => $location1_name,
-          'location_settings' => $settings,
+    $node = $this->drupalCreateNode(
+      array(
+        'type' => $location_type,
+        'locations' => array(
+          0 => array(
+            'name' => $location1_name,
+            'location_settings' => $settings,
+          ),
         ),
-      ),
-    ));
+      )
+    );
 
     // Reload the node.
     $node = node_load($node->nid, NULL, TRUE);
@@ -144,12 +164,14 @@ class CowInstanceTest extends LocationTestCase {
     // Get the full location
     $location = $node->locations[0];
 
-    $node2 = $this->drupalCreateNode(array(
-      'type' => $location_type,
-      'locations' => array(
-        '0' => $location,
-      ),
-    ));
+    $node2 = $this->drupalCreateNode(
+      array(
+        'type' => $location_type,
+        'locations' => array(
+          '0' => $location,
+        ),
+      )
+    );
 
     // Reload second node.
     $node2 = node_load($node2->nid, NULL, TRUE);
@@ -162,7 +184,11 @@ class CowInstanceTest extends LocationTestCase {
     // Force another reload.
     $node2 = node_load($node2->nid, NULL, TRUE);
 
-    $this->assertEqual($node2->locations[0]['lid'], $location['lid'], t('Ensuring shared location is not prematurely garbage collected'));
+    $this->assertEqual(
+      $node2->locations[0]['lid'],
+      $location['lid'],
+      t('Ensuring shared location is not prematurely garbage collected')
+    );
 
     $this->deleteNode($node2->nid);
 
@@ -184,19 +210,21 @@ class CowInstanceTest extends LocationTestCase {
     $location2_name = $this->randomName();
     $location3_name = $this->randomName();
 
-    $node = $this->drupalCreateNode(array(
-      'type' => $location_type,
-      'locations' => array(
-        0 => array( // First
-          'name' => $location1_name,
-          'location_settings' => $settings,
-        ),
-        1 => array( // Second
-          'name' => $location2_name,
-          'location_settings' => $settings,
+    $node = $this->drupalCreateNode(
+      array(
+        'type' => $location_type,
+        'locations' => array(
+          0 => array( // First
+            'name' => $location1_name,
+            'location_settings' => $settings,
+          ),
+          1 => array( // Second
+            'name' => $location2_name,
+            'location_settings' => $settings,
+          ),
         ),
-      ),
-    ));
+      )
+    );
 
     // Reload the node.
     $node = node_load($node->nid, NULL, TRUE);
@@ -226,16 +254,27 @@ class CowInstanceTest extends LocationTestCase {
     $this->reorderLocations($node2);
 
     $this->assertEqual(count($node1->locations), 2, t('Ensuring second revision did not affect first revision'));
-    $this->assertEqual($node->locations[0]['lid'], $node1->locations[0]['lid'], t('Ensuring second revision did not affect first revision'));
-    $this->assertEqual($node->locations[1]['lid'], $node1->locations[1]['lid'], t('Ensuring second revision did not affect first revision'));
+    $this->assertEqual(
+      $node->locations[0]['lid'],
+      $node1->locations[0]['lid'],
+      t('Ensuring second revision did not affect first revision')
+    );
+    $this->assertEqual(
+      $node->locations[1]['lid'],
+      $node1->locations[1]['lid'],
+      t('Ensuring second revision did not affect first revision')
+    );
 
     $this->assertEqual(count($node2->locations), 2, t('Ensuring second revision does not have stealth locations'));
 
     // Delete first revision.
-    db_query("DELETE FROM {node_revision} WHERE nid = :nid AND vid = :vid", array(
-      ':nid' => $node1->nid,
-      ':vid' => $node1->vid
-    ));
+    db_query(
+      "DELETE FROM {node_revision} WHERE nid = :nid AND vid = :vid",
+      array(
+        ':nid' => $node1->nid,
+        ':vid' => $node1->vid
+      )
+    );
     $this->assertFalse(node_revision_delete($node1->vid));
 
 // @todo fixme
@@ -262,15 +301,17 @@ class CowInstanceTest extends LocationTestCase {
 
     $location1_name = $this->randomName();
 
-    $node = $this->drupalCreateNode(array(
-      'type' => $location_type,
-      'locations' => array(
-        0 => array(
-          'name' => $location1_name,
-          'location_settings' => $settings,
+    $node = $this->drupalCreateNode(
+      array(
+        'type' => $location_type,
+        'locations' => array(
+          0 => array(
+            'name' => $location1_name,
+            'location_settings' => $settings,
+          ),
         ),
-      ),
-    ));
+      )
+    );
 
     // Reload the node.
     $node = node_load($node->nid, NULL, TRUE);
diff --git a/tests/google_geocoder.test b/tests/google_geocoder.test
index 0f5773f..abc2cda 100644
--- a/tests/google_geocoder.test
+++ b/tests/google_geocoder.test
@@ -38,20 +38,22 @@ class LocationGoogleGeocoderTest extends LocationTestCase {
 
     $location1_name = $this->randomName();
 
-    $node = $this->drupalCreateNode(array(
-      'type' => $location_type,
-      'locations' => array(
-        0 => array(
-          'name' => $location1_name,
-          'location_settings' => $settings,
-          'street' => '1600 Amphitheatre Parkway',
-          'city' => 'Mountain View',
-          'province' => 'CA',
-          'postal_code' => '94043',
-          'country' => 'us',
+    $node = $this->drupalCreateNode(
+      array(
+        'type' => $location_type,
+        'locations' => array(
+          0 => array(
+            'name' => $location1_name,
+            'location_settings' => $settings,
+            'street' => '1600 Amphitheatre Parkway',
+            'city' => 'Mountain View',
+            'province' => 'CA',
+            'postal_code' => '94043',
+            'country' => 'us',
+          ),
         ),
-      ),
-    ));
+      )
+    );
 
     // Reload the node.
     $node2 = node_load($node->nid, NULL, TRUE);
diff --git a/tests/location_cck.test b/tests/location_cck.test
index f824993..bcc4a4f 100644
--- a/tests/location_cck.test
+++ b/tests/location_cck.test
@@ -84,6 +84,7 @@ class LocationCCKTest extends LocationCCK2Test {
 
     $form = array();
     $this->drupalPost(NULL, $form, 'Save field settings');
+
     return $name;
   }
 
diff --git a/tests/location_cck2.test b/tests/location_cck2.test
index 31832f4..c0e60f2 100644
--- a/tests/location_cck2.test
+++ b/tests/location_cck2.test
@@ -52,6 +52,7 @@ class LocationCCK2Test extends LocationTestCase {
     if (!self::$name) {
       $this->addLocationContentType2();
     }
+
     return self::$name;
   }
 
@@ -59,6 +60,7 @@ class LocationCCK2Test extends LocationTestCase {
     if (!self::$field_name) {
       $this->addLocationContentType2();
     }
+
     return self::$field_name;
   }
 
@@ -119,9 +121,11 @@ class LocationCCK2Test extends LocationTestCase {
     $this->assertTrue($this->getTestContentName(), t('Content type' . $this->getTestContentName() . ' created'));
 
     // test node creation
-    $node2 = $this->drupalCreateNode(array(
-      'type' => $this->getTestContentName(),
-    ));
+    $node2 = $this->drupalCreateNode(
+      array(
+        'type' => $this->getTestContentName(),
+      )
+    );
 // @todo remove debug
 //    $this->fail('<pre>' . print_r($node2, TRUE) . '</pre>', 'Debug');
     $fieldname = 'field_' . $this->getTestFieldName();
diff --git a/tests/location_testcase.php b/tests/location_testcase.php
index 1a514ec..eae83c2 100644
--- a/tests/location_testcase.php
+++ b/tests/location_testcase.php
@@ -4,7 +4,6 @@
  * @file
  * Common functions for Location tests.
  */
-
 class LocationTestCase extends DrupalWebTestCase {
 
 //
@@ -23,10 +22,17 @@ class LocationTestCase extends DrupalWebTestCase {
       $lower = $test - $epsilon;
       $upper = $test + $epsilon;
       if ($result[$k] < $lower || $result[$k] > $upper) {
-        $this->assert('fail', $message ? $message : t('Value deviates by @amt, which is more than @maxdev.', array(
-          '@amt' => abs($test - $result[$k]),
-          '@maxdev' => $epsilon
-        )), $group);
+        $this->assert(
+          'fail',
+          $message ? $message : t(
+            'Value deviates by @amt, which is more than @maxdev.',
+            array(
+              '@amt' => abs($test - $result[$k]),
+              '@maxdev' => $epsilon
+            )
+          ),
+          $group
+        );
       }
       else {
         $this->assert('pass', $message ? $message : t('Value within expected margin.'), $group);
@@ -53,6 +59,7 @@ class LocationTestCase extends DrupalWebTestCase {
       // Change collection to allow.
       $defaults[$k]['collect'] = 1;
     }
+
     return $defaults;
   }
 
@@ -104,6 +111,7 @@ class LocationTestCase extends DrupalWebTestCase {
     $this->drupalPost('admin/structure/types/add', $settings, 'Save content type');
     $this->refreshVariables();
     $settings = variable_get('location_settings_node_' . $name, array());
+
     return $name;
   }
 
@@ -177,10 +185,16 @@ class LocationTestCase extends DrupalWebTestCase {
     $this->drupalPost('node/add/' . str_replace('_', '-', $type), $edit, t('Save'));
 
     $node = node_load(array('title' => $edit['title']));
-    $this->assertRaw(t('@type %title has been created.', array(
-      '@type' => node_get_types('name', $node),
-      '%title' => $edit['title']
-    )), t('Node created successfully.'));
+    $this->assertRaw(
+      t(
+        '@type %title has been created.',
+        array(
+          '@type' => node_get_types('name', $node),
+          '%title' => $edit['title']
+        )
+      ),
+      t('Node created successfully.')
+    );
 
     return $node;
   }
diff --git a/tests/location_testcase.test b/tests/location_testcase.test
index 1a514ec..eae83c2 100644
--- a/tests/location_testcase.test
+++ b/tests/location_testcase.test
@@ -4,7 +4,6 @@
  * @file
  * Common functions for Location tests.
  */
-
 class LocationTestCase extends DrupalWebTestCase {
 
 //
@@ -23,10 +22,17 @@ class LocationTestCase extends DrupalWebTestCase {
       $lower = $test - $epsilon;
       $upper = $test + $epsilon;
       if ($result[$k] < $lower || $result[$k] > $upper) {
-        $this->assert('fail', $message ? $message : t('Value deviates by @amt, which is more than @maxdev.', array(
-          '@amt' => abs($test - $result[$k]),
-          '@maxdev' => $epsilon
-        )), $group);
+        $this->assert(
+          'fail',
+          $message ? $message : t(
+            'Value deviates by @amt, which is more than @maxdev.',
+            array(
+              '@amt' => abs($test - $result[$k]),
+              '@maxdev' => $epsilon
+            )
+          ),
+          $group
+        );
       }
       else {
         $this->assert('pass', $message ? $message : t('Value within expected margin.'), $group);
@@ -53,6 +59,7 @@ class LocationTestCase extends DrupalWebTestCase {
       // Change collection to allow.
       $defaults[$k]['collect'] = 1;
     }
+
     return $defaults;
   }
 
@@ -104,6 +111,7 @@ class LocationTestCase extends DrupalWebTestCase {
     $this->drupalPost('admin/structure/types/add', $settings, 'Save content type');
     $this->refreshVariables();
     $settings = variable_get('location_settings_node_' . $name, array());
+
     return $name;
   }
 
@@ -177,10 +185,16 @@ class LocationTestCase extends DrupalWebTestCase {
     $this->drupalPost('node/add/' . str_replace('_', '-', $type), $edit, t('Save'));
 
     $node = node_load(array('title' => $edit['title']));
-    $this->assertRaw(t('@type %title has been created.', array(
-      '@type' => node_get_types('name', $node),
-      '%title' => $edit['title']
-    )), t('Node created successfully.'));
+    $this->assertRaw(
+      t(
+        '@type %title has been created.',
+        array(
+          '@type' => node_get_types('name', $node),
+          '%title' => $edit['title']
+        )
+      ),
+      t('Node created successfully.')
+    );
 
     return $node;
   }
