diff --git a/drealty.daemon.php b/drealty.daemon.php
index c405d28..0929ddb 100644
--- a/drealty.daemon.php
+++ b/drealty.daemon.php
@@ -6,13 +6,13 @@ class drealtyDaemon {
 
   /**
    *
-   * @var drealtyConnection 
+   * @var drealtyConnection
    */
   protected $dc;
 
   /**
    *
-   * @var drealtyMetaData 
+   * @var drealtyMetaData
    */
   protected $dm;
 
@@ -76,7 +76,7 @@ class drealtyDaemon {
    * @param drealtyConnectionEntity $connection
    * @param drealtyRetsResource $resource
    * @param drealtyRetsClass $class
-   * @param string $entity_type 
+   * @param string $entity_type
    */
   private function ProcessRetsClass(drealtyConnectionEntity $connection, $resource, $class, $entity_type) {
 
@@ -134,7 +134,7 @@ class drealtyDaemon {
    * @param drealtyRetsResource $resource
    * @param drealtyRetsClass $class
    * @param string $key_field
-   * @return int 
+   * @return int
    */
   function fetch_listings_offset_not_supported_key(drealtyConnectionEntity $connection, $resource, $class, $key_field) {
     $rets = $this->dc->rets;
@@ -199,7 +199,8 @@ class drealtyDaemon {
           $id = (int) $id + 1;
 
           unset($listings);
-        } else {
+        }
+        else {
           break;
         }
 
@@ -209,7 +210,8 @@ class drealtyDaemon {
         $query = "({$key_field}={$id}+)";
       }
       $this->dc->disconnect();
-    } else {
+    }
+    else {
       $error = $rets->Error();
       watchdog('drealty', "drealty encountered an error: (Type: @type Code: @code Msg: @text)", array("@type" => $error['type'], "@code" => $error['code'], "@text" => $error['text']), WATCHDOG_ERROR);
       drush_log(dt("drealty encountered an error: (Type: @type Code: @code Msg: @text)", array("@type" => $error['type'], "@code" => $error['code'], "@text" => $error['text']), 'error'));
@@ -222,7 +224,7 @@ class drealtyDaemon {
    * @param drealtyRetsResource $resource
    * @param drealtyRetsClass $class
    * @param string $key_field
-   * @return int 
+   * @return int
    */
   function fetch_listings_offset_not_supported_price(drealtyConnectionEntity $connection, $resource, $class, $key_field) {
     $rets = $this->dc->rets;
@@ -283,12 +285,14 @@ class drealtyDaemon {
           $offset_start = $offset_end + 1;
           $offset_end += $offset_amount;
           $offset_query = "$query,({$class->offset_field}={$offset_start}-{$offset_end})";
-        } else {
+        }
+        else {
           $offset_query = "$query,({$class->offset_field}={$offset_max}+)";
         }
       }
       $this->dc->disconnect();
-    } else {
+    }
+    else {
       $error = $rets->Error();
       watchdog('drealty', "drealty encountered an error: (Type: @type Code: @code Msg: @text)", array("@type" => $error['type'], "@code" => $error['code'], "@text" => $error['text']), WATCHDOG_ERROR);
       drush_log(dt("drealty encountered an error: (Type: @type Code: @code Msg: @text)", array("@type" => $error['type'], "@code" => $error['code'], "@text" => $error['text']), 'error'));
@@ -302,7 +306,7 @@ class drealtyDaemon {
    * @param drealtyRetsResource $resource
    * @param drealtyRetsClass $class
    * @param string $query
-   * @return int 
+   * @return int
    */
   function fetch_listings_offset_supported_default(drealtyConnectionEntity $connection, $resource, $class, $query) {
     $offset = 0;
@@ -371,7 +375,8 @@ class drealtyDaemon {
 
         if ($limit == 'NONE') {
           $end = FALSE;
-        } else {
+        }
+        else {
           $end = $rets->IsMaxrowsReached();
         }
         $rets->FreeResult($search);
@@ -380,7 +385,8 @@ class drealtyDaemon {
 
 // do some cleanup
       unset($items);
-    } else {
+    }
+    else {
       $error = $rets->Error();
       watchdog('drealty', "drealty encountered an error: (Type: @type Code: @code Msg: @text)", array("@type" => $error['type'], "@code" => $error['code'], "@text" => $error['text']), WATCHDOG_ERROR);
       drush_log(dt("drealty encountered an error: (Type: @type Code: @code Msg: @text)", array("@type" => $error['type'], "@code" => $error['code'], "@text" => $error['text']), 'error'));
@@ -486,7 +492,7 @@ class drealtyDaemon {
    * @param drealtyRetsResource $resource
    * @param drealtyRetsClass $class
    * @param string $entity_type
-   * @param int $chunk_count 
+   * @param int $chunk_count
    */
   protected function process_results(drealtyConnectionEntity $connection, $resource, $class, $entity_type) {
 
@@ -523,13 +529,14 @@ class drealtyDaemon {
         $is_new = TRUE;
         $item = entity_create($entity_type, array('conid' => $connection->conid, 'type' => $class->bundle));
 
-        // this listing either doesn't exist in the IDX or has changed. 
+        // this listing either doesn't exist in the IDX or has changed.
         // determine if we need to update or create a new one.
         if (isset($existing_items[$rets_item[$id]])) {
           // this listing exists so we'll get a reference to it and set the values to what came to us in the RETS result
           $item = reset(entity_load($entity_type, array($existing_items[$rets_item[$id]]->id)));
           $is_new = FALSE;
-        } else {
+        }
+        else {
           $item->created = time();
         }
 
@@ -544,16 +551,19 @@ class drealtyDaemon {
           if ($is_new) {
             $item->process_images = TRUE;
             $item->rets_photo_modification_timestamp = $rets_item[$class->photo_timestamp_field];
-          } else {
+          }
+          else {
             if (isset($item->rets_photo_modification_timestamp)) {
               $last_time = strtotime($item->rets_photo_modification_timestamp);
               $this_time = strtotime($rets_item[$class->photo_timestamp_field]);
               if ($this_time > $last_time) {
                 $item->process_images = TRUE;
-              } else {
+              }
+              else {
                 $item->process_images = FALSE;
               }
-            } else {
+            }
+            else {
               // hasn't been set but it's not new
               $item->rets_photo_modification_timestamp = $rets_item[$class->photo_timestamp_field];
               $item->process_images = FALSE;
@@ -573,7 +583,8 @@ class drealtyDaemon {
               }
             }
           }
-        } else {
+        }
+        else {
           $force_geocode = TRUE;
         }
 
@@ -592,7 +603,8 @@ class drealtyDaemon {
         }
         drush_log(dt('Saving item @name. [@count of @total]', array("@name" => $rets_item[$id], "@count" => $count, "@total" => $total)));
         unset($item);
-      } else {
+      }
+      else {
         // skipping this item
         drush_log(dt("Skipping item @name. [@count of @total]", array("@name" => $rets_item[$id], "@count" => $count, "@total" => $total)));
         $this->queue->deleteItem($queue_item);
@@ -607,10 +619,10 @@ class drealtyDaemon {
 
   /**
    * Function to handle the logic of what to do with expired listings
-   * 
+   *
    * @param array $in_rets
    * @param array $conid
-   * @param drealtyRetsClass $class 
+   * @param drealtyRetsClass $class
    */
   protected function handle_expired($in_rets, $conid, $class) {
 
@@ -692,7 +704,7 @@ class drealtyDaemon {
    * @param int $conid
    * @param drealtyRetsResource $resource
    * @param drealtyRetsClass $class
-   * @return type 
+   * @return type
    */
   public function process_images($conid, $resource, $class) {
 
@@ -701,9 +713,9 @@ class drealtyDaemon {
     }
 
     /* grab any address fields so we can set changed = false
-     * doing this so that geocoder wont re-geocode an address field 
+     * doing this so that geocoder wont re-geocode an address field
      * on entity->save().
-     * 
+     *
      * There's got to be a better way to do this, however, this will work for now.
      */
 
@@ -726,7 +738,8 @@ class drealtyDaemon {
 
     if (!empty($result[$entity_type])) {
       $items = array_keys($result[$entity_type]); //entity_load($entity_type, array_keys($result[$entity_type]));
-    } else {
+    }
+    else {
       drush_log("No images to process.");
       return;
     }
@@ -739,7 +752,8 @@ class drealtyDaemon {
       if (!file_prepare_directory($img_dir, FILE_MODIFY_PERMISSIONS | FILE_CREATE_DIRECTORY)) {
         drush_log(dt("Failed to create %directory.", array('%directory' => $img_dir)), "error");
         return;
-      } else {
+      }
+      else {
         if (!is_dir($img_dir)) {
           drush_log(dt("Failed to locate %directory.", array('%directory' => $img_dir)), "error");
           return;
@@ -789,7 +803,8 @@ class drealtyDaemon {
                     $photos[$item['Content-ID']] = array();
                   }
                   $photos[$item['Content-ID']][$item['Object-ID']] = $item;
-                } else {
+                }
+                else {
                   drush_log(dt("Images failed to download: @code - @text", array('@code' => $item['ReplyCode'], '@text' => $item['ReplyText'])), 'warning');
                 }
               }
@@ -800,7 +815,8 @@ class drealtyDaemon {
               ksort($set, SORT_NUMERIC);
             }
             drush_log(dt("Downloaded a total of @total images for @count Listings.", array("@total" => $total, "@count" => count($ids))));
-          } else {
+          }
+          else {
             drush_log(dt("GetObject for @resource - @class returned an empty result set.", array('@resource' => $resource->systemname, '@class' => $class->systemname)), 'warning');
           }
 
@@ -915,7 +931,8 @@ class drealtyDaemon {
         case 'addressfield':
           if ($force_geocode) {
             $item->{$mapping->field_name}[LANGUAGE_NONE][0]['changed'] = TRUE;
-          } else {
+          }
+          else {
             $item->{$mapping->field_name}[LANGUAGE_NONE][0]['changed'] = FALSE;
           }
           //get the default country code if one exists for the address
@@ -941,7 +958,7 @@ class drealtyDaemon {
           $item->{$mapping->field_name}[LANGUAGE_NONE][0]['value'] = empty($rets_item[$mapping->systemname]) ? 0 : is_numeric($rets_item[$mapping->systemname]) ? $rets_item[$mapping->systemname] : 0;
           break;
         case 'list_boolean':
-          $item->{$mapping->field_name}[LANGUAGE_NONE][0]['value'] = in_array($rets_item[$mapping->systemname], array('true', 'True', 'TRUE', 'yes', 'Yes', 'y', 'Y', '1', 'on', 'On', 'ON', true, 1), true) ? 1 : 0;
+          $item->{$mapping->field_name}[LANGUAGE_NONE][0]['value'] = in_array($rets_item[$mapping->systemname], array('true', 'True', 'TRUE', 'yes', 'Yes', 'y', 'Y', '1', 'on', 'On', 'ON', TRUE, 1), TRUE) ? 1 : 0;
           break;
         case 'drealty':
           $item->{$mapping->field_name} = $rets_item[$mapping->systemname];
diff --git a/drealty.install b/drealty.install
index c5dc696..6bf1a84 100644
--- a/drealty.install
+++ b/drealty.install
@@ -148,7 +148,7 @@ function drealty_schema() {
       'offset_field' => array('type' => 'varchar', 'length' => 50, 'not null' => FALSE),
       'offset_amount' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
       'offset_max' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'photo_timestamp_field' => array('type' => 'varchar', 'length' => 50, 'not null' =>FALSE, 'default' => NULL),
+      'photo_timestamp_field' => array('type' => 'varchar', 'length' => 50, 'not null' => FALSE, 'default' => NULL),
       'expired_handler' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
     ),
     'primary key' => array('cid'),
@@ -302,7 +302,7 @@ function drealty_update_7300(&$sandbox) {
 
 
 /**
- * Add fields to handle expired listings 
+ * Add fields to handle expired listings
  */
 function drealty_update_7301(&$sandbox) {
   db_add_field('drealty_listing', 'active', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 1));
@@ -311,7 +311,7 @@ function drealty_update_7301(&$sandbox) {
 
 /**
  * Adjust length of 'rets_key' field to hold more data.
- * 
+ *
  * See: http://drupal.org/node/1514350
  */
 
@@ -328,4 +328,4 @@ function drealty_update_7302(&$sandbox) {
     'not null' => FALSE,
     'description' => 'A unique identifier for this record from the source system. Typically this is the MLS #, however systems like Interealty use a sysid field. Select the apporpriate field.',
   ));
-}
\ No newline at end of file
+}
diff --git a/drealty.module b/drealty.module
index 916af9c..e541989 100644
--- a/drealty.module
+++ b/drealty.module
@@ -182,7 +182,6 @@ function drealty_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  * @param type $form
  * @param array $form_state
  * @param drealtyListing $listing
- * @return type 
  */
 function drealty_update_single_listing($form, &$form_state, $listing = NULL) {
 
@@ -205,7 +204,8 @@ function drealty_update_single_listing_submit($form, &$form_state) {
   $daemon = new drealtyDaemon();
   if ($daemon->update_single_listing($listing)) {
     drupal_set_message(t('Listing id %id was successfully updated from the RETS server.', array('%id' => $listing->rets_id)), 'status');
-  } else {
+  }
+  else {
     drupal_set_message(t('Listing id %id FAILED to update from the RETS server.', array('%id' => $listing->rets_id)), 'error');
   }
   $form_state['redirect'] = $listing->path();
@@ -238,7 +238,8 @@ function drealty_admin_menu_block_page() {
   $item = menu_get_item();
   if ($content = system_admin_menu_block($item)) {
     $output = theme('admin_block_content', array('content' => $content));
-  } else {
+  }
+  else {
     $output = t('You do not have any administrative items.');
   }
   return $output;
@@ -560,7 +561,8 @@ function drealty_listing_access($op, $listing = NULL, $account = NULL) {
   // access.
   if (in_array(FALSE, $access, TRUE)) {
     return FALSE;
-  } elseif (in_array(TRUE, $access, TRUE)) {
+  }
+  elseif (in_array(TRUE, $access, TRUE)) {
     return TRUE;
   }
   return FALSE;
@@ -905,7 +907,8 @@ function drealty_field_ui_field_overview_form_submit($form, &$form_state) {
       $instance = field_read_instance($entity_type, $key, $bundle);
       $instance['widget']['weight'] = $values['weight'];
       field_update_instance($instance);
-    } elseif (in_array($key, $form['#extra'])) {
+    }
+    elseif (in_array($key, $form['#extra'])) {
       $bundle_settings['extra_fields']['form'][$key]['weight'] = $values['weight'];
     }
   }
@@ -957,7 +960,8 @@ function drealty_field_ui_field_overview_form_submit($form, &$form_state) {
     $field = field_info_field($values['field_name']);
     if (!empty($field['locked'])) {
       drupal_set_message(t('The field %label cannot be added because it is locked.', array('%label' => $values['label'])), 'error');
-    } else {
+    }
+    else {
       $instance = array(
         'field_name' => $field['field_name'],
         'entity_type' => $entity_type,
@@ -985,7 +989,8 @@ function drealty_field_ui_field_overview_form_submit($form, &$form_state) {
     $destinations[] = $destination['destination'];
     unset($_GET['destination']);
     $form_state['redirect'] = field_ui_get_destinations($destinations);
-  } else {
+  }
+  else {
     drupal_set_message(t('Your settings have been saved.'));
   }
 }
@@ -1012,4 +1017,4 @@ function drealty_ctools_plugin_type() {
   return array(
     'geocoder_handler' => array(),
   );
-}
\ No newline at end of file
+}
diff --git a/includes/drealty.admin.inc b/includes/drealty.admin.inc
index a39c4e3..5aa4295 100644
--- a/includes/drealty.admin.inc
+++ b/includes/drealty.admin.inc
@@ -34,7 +34,7 @@ function drealty_settings_form($form, &$form_state) {
       // check the count
       if (count($count) > 0) {
 
-        // add the config field        
+        // add the config field
         $form['general_settings']['connections'][$key]['office_id'] = array(
             '#type' => 'textfield',
             '#default_value' => $connection->office_id,
@@ -42,12 +42,14 @@ function drealty_settings_form($form, &$form_state) {
             '#description' => t('Begin typing the name of the agency and select if from the autocmplete list. The office id will then be populated for you.'),
             '#title' => t('Office Id')
         );
-      } else {
+      }
+      else {
         $form['general_settings']['connections'][$key]['office_id'] = array(
             '#markup' => t("This connection does not appear to have any Office Resource Types imported. Please ensure you have it configured correctly !here and run the rets-import command from drush.", array('!here' => l(t('here'), "admin/drealty/connections/manage/{$connection->name}/resource/drealty_office")))
         );
       }
-    } else {
+    }
+    else {
       $form['general_settings']['connections'][$key]['office_id'] = array(
           '#markup' => t("This connection does not appear to have the Office Resource Type configured. Configure it !here.", array('!here' => l(t('here'), "admin/drealty/connections/manage/{$connection->name}/resource/drealty_office")))
       );
@@ -157,4 +159,4 @@ function drealty_office_autocomplete_callback($conid, $string) {
   }
   print drupal_json_encode($matches);
   exit();
-}
\ No newline at end of file
+}
diff --git a/includes/drealty.connection.admin.inc b/includes/drealty.connection.admin.inc
index 1099641..b74649b 100644
--- a/includes/drealty.connection.admin.inc
+++ b/includes/drealty.connection.admin.inc
@@ -88,7 +88,8 @@ class DrealtyConnectionUIController extends EntityDefaultUIController {
       if ($active) {
         $operation .= l("Deactivate", "admin/drealty/connections/manage/$name/deactivate");
         $operation .= " | " . l("Configure", "admin/drealty/connections/manage/$name/resource/drealty_listing");
-      } else {
+      }
+      else {
         $operation .= l("Activate", "admin/drealty/connections/manage/$name/activate");
       }
       $additional = array($operation);
@@ -280,7 +281,8 @@ function drealty_activate_connection_form($form, &$form_state, $connection = NUL
   $form_state['connection'] = $connection;
   if (!isset($connection->conid)) {
     drupal_set_message(t("Must have a connection selected."), 'error');
-  } else {
+  }
+  else {
 
     $dc = new drealtyConnection();
 
@@ -320,7 +322,8 @@ function drealty_activate_connection_form($form, &$form_state, $connection = NUL
         '#value' => t('Activate'),
       );
       $dc->disconnect();
-    } else {
+    }
+    else {
       $error = $dc->rets->Error();
       drupal_set_message(t("drealty encountered an error: (Type: @type Code: @code Msg: @text)", array("@type" => $error['type'], "@code" => $error['code'], "@text" => $error['text'])), 'error');
       $form['markup'] = array(
@@ -391,7 +394,8 @@ function drealty_select_resource_type($form, &$form_state) {
 // update or insert
   if (isset($mapping['mid'])) {
     drupal_write_record('drealty_resource_mappings', $mapping, array('mid'));
-  } else {
+  }
+  else {
     unset($mapping['mid']);
     drupal_write_record('drealty_resource_mappings', $mapping, array());
   }
@@ -445,7 +449,8 @@ function drealty_resource_overview_form($form, &$form_state, drealtyConnectionEn
 
       $selected_resource = $dm->FetchResource($form_state['input']['prop_resource']);
       $results = $connection->fetchClasses($selected_resource);
-    } else {
+    }
+    else {
       $selected_resource = $dm->FetchResource($mappings[$entity_type]->rid);
       $results = $connection->fetchClasses($selected_resource);
     }
@@ -485,8 +490,8 @@ function drealty_resource_overview_form($form, &$form_state, drealtyConnectionEn
       $form['classes'][$key]['cname'] = array('#value' => $class->systemname);
       $form['classes'][$key]['sname'] = array('#value' => "{$class->standardname} {$class->description}");
 
-      $form['classes'][$key]['enabled'] = array('#type' => 'checkbox', '#default_value' => $class->enabled, '#attributes' => $class->enabled ? array('checked' => 'checked') : NULL, '#disabled' => $class->configured ? FALSE : TRUE,);
-      $form['classes'][$key]['lifetime'] = array('#type' => 'select', '#options' => $life_opts, '#default_value' => isset($class->lifetime) ? $class->lifetime : 28000, '#disabled' => $class->configured ? FALSE : TRUE,);
+      $form['classes'][$key]['enabled'] = array('#type' => 'checkbox', '#default_value' => $class->enabled, '#attributes' => $class->enabled ? array('checked' => 'checked') : NULL, '#disabled' => $class->configured ? FALSE : TRUE, );
+      $form['classes'][$key]['lifetime'] = array('#type' => 'select', '#options' => $life_opts, '#default_value' => isset($class->lifetime) ? $class->lifetime : 28000, '#disabled' => $class->configured ? FALSE : TRUE, );
       $configure_fields_link = l("configure", "admin/drealty/connections/manage/{$connection->name}/resource/{$entity_type}/{$class->cid}");
 
       $form['classes'][$key]['actions'] = array('#markup' => "$configure_fields_link");
@@ -522,7 +527,8 @@ function drealty_resource_overview_form_submit($form, &$form_state) {
 // update or insert
   if (isset($mapping['mid'])) {
     drupal_write_record('drealty_resource_mappings', $mapping, array('mid'));
-  } else {
+  }
+  else {
     unset($mapping['mid']);
     drupal_write_record('drealty_resource_mappings', $mapping, array());
   }
@@ -691,7 +697,8 @@ function drealty_resource_configure_form($form, &$form_state, drealtyConnectionE
         'required' => array(':input[name="query_type"]' => array('value' => '0')),
       ),
     );
-  } else {
+  }
+  else {
     $form_state['status_null'] = TRUE;
 //    $form['query_options']['no_status'] = array(
 //        '#markup' => '<div>You must configure the status field</div>',
@@ -1015,7 +1022,8 @@ function drealty_resource_configure_form_submit($form, &$form_state) {
 
     $field = field_read_instance($entity_type, $class->image_field_name, $class->bundle);
     $class->image_dir = isset($field['settings']['file_directory']) ? $field['settings']['file_directory'] : "rets_images";
-  } else {
+  }
+  else {
     $class->process_images = FALSE;
     $class->object_type = NULL;
   }
@@ -1061,7 +1069,8 @@ function drealty_test_manual_query($form, &$form_state) {
     if ($dc->rets->Error()) {
       $error = $dc->rets->Error();
       drupal_set_message(t("drealty encountered an error: (Type: @type Code: @code Msg: @text)", array("@type" => $error['type'], "@code" => $error['code'], "@text" => $error['text'])), 'error');
-    } else {
+    }
+    else {
       $num_rows_returned = $dc->rets->NumRows($search);
       $total_records = $dc->rets->TotalRecordsFound($search);
       drupal_set_message("Success. RETS server returned $num_rows_returned of $total_records results.");
diff --git a/includes/drealty.connection.inc b/includes/drealty.connection.inc
index 6bedfcf..6fc35bb 100644
--- a/includes/drealty.connection.inc
+++ b/includes/drealty.connection.inc
@@ -8,25 +8,25 @@ class drealtyConnection {
 
   /**
    *
-   * @var phRETS 
+   * @var phRETS
    */
   public $rets = NULL;
 
   /**
    *
-   * @var string 
+   * @var string
    */
   private $error_string = '';
 
   /**
    *
-   * @var bool 
+   * @var bool
    */
   private $connected = FALSE;
 
   /**
    *
-   * @var drealtyConnectionEntity 
+   * @var drealtyConnectionEntity
    */
   private $current_connection = NULL;
 
@@ -63,7 +63,8 @@ class drealtyConnection {
           watchdog('drealty', $e->getMessage(), NULL, WATCHDOG_ERROR);
           return FALSE;
         }
-      } else {
+      }
+      else {
 
         $this->current_connection = $this->FetchConnection($conid);
 
@@ -82,11 +83,12 @@ class drealtyConnection {
         }
 
         if ($this->current_connection->debug_mode) {
-          $this->rets->SetParam('debug_mode', true);
+          $this->rets->SetParam('debug_mode', TRUE);
           $path = variable_get('file_private_path', FALSE);
           if ($path && !empty($path)) {
             $this->rets->SetParam("debug_file", "private://drealty_debug_log.txt");
-          } else {
+          }
+          else {
             $this->rets->SetParam("debug_file", "public://drealty_debug_log.txt");
           }
         }
@@ -118,11 +120,13 @@ class drealtyConnection {
         $error_info = $this->rets->Error();
         $this->error_string = $error_info['text'];
         throw new drealty_rets_connection_exception($error_info['text'], $error_info['code']);
-      } else {
+      }
+      else {
         // no error result present so we'll throw a generic exception
         throw new drealty_rets_connection_exception('There was an error connecting to the RETS Server.');
       }
-    } else {
+    }
+    else {
       // connection was successful!
       $this->connected = TRUE;
       return TRUE;
@@ -144,7 +148,8 @@ class drealtyConnection {
           drush_log("Disconnected from RETS server.");
         }
         return TRUE;
-      } else {
+      }
+      else {
         $error = $this->rets->Error();
         throw new drealty_rets_disconnect_exception("Error Disconnecting from the RETS Server: (Type: {$error['type']} Code: {$error['code']} Msg: {$error['text']})");
       }
@@ -153,17 +158,16 @@ class drealtyConnection {
 
   /**
    *
-   * @return drealtyConnectionEntity[] 
+   * @return drealtyConnectionEntity[]
    */
   public function FetchConnections() {
-		return entity_load('drealty_connection_entity');
+    return entity_load('drealty_connection_entity');
   }
-	
-	/**
+
+  /**
    *
    * @return configured drealtyConnectionEntity
    */
-     
   public function FetchConfiguredConnections() {
     $query = db_select('drealty_connections', 'c');
     $query->distinct();
@@ -171,7 +175,7 @@ class drealtyConnection {
     $query->condition('c.active', 1)
           ->condition('c.status', 1)
           ->fields('c');
-        		
+
     $connections = $query->execute()->fetchAllKeyed();
     return entity_load('drealty_connection_entity', array_keys($connections));
   }
@@ -179,7 +183,7 @@ class drealtyConnection {
   /**
    *
    * @param int $id
-   * @return drealtyConnectionEntity 
+   * @return drealtyConnectionEntity
    */
   public function FetchConnection($id) {
     $connection = entity_load('drealty_connection_entity', array($id));
@@ -224,7 +228,7 @@ class drealtyConnectionEntity extends Entity {
 
   /**
    *
-   * @return drealtyRetsResource[] 
+   * @return drealtyRetsResource[]
    */
   public function Resources() {
     $dm = new drealtyMetaData();
@@ -233,7 +237,7 @@ class drealtyConnectionEntity extends Entity {
 
   /**
    *
-   * @return drealtyResourceMapping[] 
+   * @return drealtyResourceMapping[]
    */
   public function ResourceMappings() {
     $dm = new drealtyMetaData();
@@ -243,7 +247,7 @@ class drealtyConnectionEntity extends Entity {
   /**
    *
    * @param drealtyRetsResource $resource
-   * @return drealtyRetsClass[] 
+   * @return drealtyRetsClass[]
    */
   public function FetchClasses($resource = NULL) {
     $dm = new drealtyMetaData();
@@ -252,7 +256,7 @@ class drealtyConnectionEntity extends Entity {
 
   /**
    *
-   * @return drealtyRetsClass[] 
+   * @return drealtyRetsClass[]
    */
   public function FetchEnabledClasses() {
     $dm = new drealtyMetaData();
@@ -262,7 +266,7 @@ class drealtyConnectionEntity extends Entity {
   /**
    *
    * @param drealtyRetsResource $resource
-   * @return drealtyRetsField[] 
+   * @return drealtyRetsField[]
    */
   public function FetchFields($resource, $class) {
     $dm = new drealtyMetaData();
@@ -289,7 +293,7 @@ class drealtyConnectionEntity extends Entity {
    * @param string $systemname
    * @param int $class
    * @param string $field_api_type
-   * @param array $data 
+   * @param array $data
    */
   public function CreateFieldMapMapping($rid, $field_name, $systemname, $class_id, $field_api_type = 'drealty', $data = NULL, $hash_exclude = 0) {
     // remove any mapping and create a new one
@@ -361,7 +365,7 @@ class drealtyConnectionEntityContoller extends EntityAPIControllerExportable {
   /**
    *
    * @param drealtyConnectionEntity $entity
-   * @param string $prefix 
+   * @param string $prefix
    */
   public function export($entity, $prefix = '') {
     $entity->active = 0;
@@ -433,7 +437,7 @@ class drealtyConnectionEntityContoller extends EntityAPIControllerExportable {
 
   public function import($export) {
     if (($entity = parent::import($export)) !== FALSE) {
-      $entity->imported = true;
+      $entity->imported = TRUE;
       return $entity;
     }
     return FALSE;
@@ -497,7 +501,8 @@ class drealtyConnectionEntityContoller extends EntityAPIControllerExportable {
         foreach ($entity->field_fields as $field) {
           if (!field_read_field($field['field_name'], array('include_inactive' => TRUE))) {
             field_create_field($field);
-          } else {
+          }
+          else {
             drupal_set_message(t('Skipped creating field %field. A field with this name already exists.', array('%field' => $field['field_name'])), 'warning');
           }
         }
@@ -508,7 +513,8 @@ class drealtyConnectionEntityContoller extends EntityAPIControllerExportable {
           foreach ($bundle as $instance) {
             if (!field_read_instance($instance['entity_type'], $instance['field_name'], $instance['bundle'])) {
               field_create_instance($instance);
-            } else {
+            }
+            else {
               drupal_set_message(t('Skipped creating instance %instance. An instance with this name already exists.', array('%field' => $instance['label'])), 'warning');
             }
           }
@@ -527,13 +533,13 @@ class drealtyConnectionEntityContoller extends EntityAPIControllerExportable {
 }
 
 class drealty_no_active_connection_exception extends Exception {
-  
+
 }
 
 class drealty_rets_disconnect_exception extends Exception {
-  
+
 }
 
 class drealty_rets_connection_exception extends Exception {
-  
+
 }
diff --git a/includes/drealty.listing.admin.inc b/includes/drealty.listing.admin.inc
index 11fdee1..a5054a7 100644
--- a/includes/drealty.listing.admin.inc
+++ b/includes/drealty.listing.admin.inc
@@ -128,7 +128,8 @@ function drealty_listing_add_page() {
   $item = menu_get_item();
   if ($content = system_admin_menu_block($item)) {
     $output = theme('admin_block_content', array('content' => $content));
-  } else {
+  }
+  else {
     $output = t('You do not have any administrative items.');
   }
   return $output;
@@ -138,7 +139,8 @@ function drealty_listing_admin($type = 'new') {
   $edit = $_POST;
   if (isset($edit['operation']) && ($edit['operation'] == 'delete') && isset($edit['listings']) && $edit['listings']) {
     return drupal_get_form('drealty_listing_multiple_delete_confirm');
-  } else {
+  }
+  else {
     return drupal_get_form('drealty_listing_admin_overview', $type);
   }
 }
@@ -201,7 +203,7 @@ function drealty_listing_edit_form($form, &$form_state, $op, $listing) {
 
 
   if ($listing->rets_imported) {
-    
+
   }
 
   field_attach_form('drealty_listing', $listing, $form, $form_state);
@@ -346,7 +348,8 @@ class DrealtyListingTypeUIController extends EntityDefaultUIController {
           $vars = array('%entity' => $this->entityInfo['label'], '%label' => $label);
           form_set_error('import', t('Import of %entity %label failed, a %entity with the same machine name already exists. Check the overwrite option to replace it.', $vars));
         }
-      } else {
+      }
+      else {
         form_set_error('import', t('Import failed.'));
       }
     }
diff --git a/includes/drealty.listing.inc b/includes/drealty.listing.inc
index 0aec32b..63528ef 100644
--- a/includes/drealty.listing.inc
+++ b/includes/drealty.listing.inc
@@ -99,13 +99,13 @@ class DrealtyListing extends Entity {
 }
 
 /**
- * 
+ *
  */
 class DrealtyListingController extends EntityAPIController {
 
   /**
    *
-   * @param type $entityType 
+   * @param type $entityType
    */
   public function __construct($entityType) {
     parent::__construct($entityType);
@@ -117,7 +117,7 @@ class DrealtyListingController extends EntityAPIController {
    * @param type $view_mode
    * @param type $langcode
    * @param type $content
-   * @return string 
+   * @return string
    */
   public function buildContent($entity, $view_mode = 'full', $langcode = NULL, $content = array()) {
     $content = parent::buildContent($entity, $view_mode, $langcode, $content);
@@ -176,7 +176,7 @@ class DrealtyListingTypeController extends EntityAPIControllerExportable {
    *
    * @param DrealtyListingType $entity
    * @param string $prefix
-   * @return string 
+   * @return string
    */
   public function export($entity, $prefix = '') {
     $vars = get_object_vars($entity);
@@ -208,7 +208,8 @@ class DrealtyListingTypeController extends EntityAPIControllerExportable {
       foreach ($entity->fields as $field) {
         if (!field_read_field($field['field_name'], array('include_inactive' => TRUE))) {
           field_create_field($field);
-        } else {
+        }
+        else {
           drupal_set_message(t('Skipped creating field %field. A field with this name already exists.', array('%field' => $field['field_name'])), 'warning');
         }
       }
@@ -222,4 +223,4 @@ class DrealtyListingTypeController extends EntityAPIControllerExportable {
     }
   }
 
-}
\ No newline at end of file
+}
diff --git a/includes/drealty.metadata.inc b/includes/drealty.metadata.inc
index 1ea432d..554ddda 100644
--- a/includes/drealty.metadata.inc
+++ b/includes/drealty.metadata.inc
@@ -10,7 +10,7 @@ class drealtyMetaData {
 
   /**
    * Internal Function to log errors.
-   * @param phRETS $rets 
+   * @param phRETS $rets
    */
   private function handleRetsError(phRETS $rets) {
     $error = $rets->Error();
@@ -21,7 +21,7 @@ class drealtyMetaData {
    *
    * @param integer $conid
    * @param drealtyRetsResource $resource
-   * @return drealtyRetsField[] 
+   * @return drealtyRetsField[]
    */
   function GetActiveFields($conid, $resource) {
 
@@ -40,7 +40,7 @@ class drealtyMetaData {
    * @param integer $conid
    * @return drealtyResourceMapping[]
    *  or FALSE if no mappings are found
-   *   
+   *
    */
   function GetResourceMappings($conid) {
 
@@ -72,8 +72,8 @@ class drealtyMetaData {
     if (isset($class)) {
       $query->condition('cid', $class->cid);
     }
-    
-    if(isset($type)) {
+
+    if (isset($type)) {
       $query->condition('field_api_type', $type);
     }
 
@@ -85,14 +85,14 @@ class drealtyMetaData {
     }
     return empty($mappings) ? FALSE : $mappings;
   }
- 
+
   function ExportFieldMappings($conid) {
     $mappings = db_select('drealty_field_mappings', 'm')
       ->fields('m')
       ->condition('conid', $conid)
       ->execute()
       ->fetchAll();
-    
+
     if (!empty($mappings)) {
       foreach ($mappings as $mapping) {
         $mapping->data = unserialize($mapping->data);
@@ -103,7 +103,7 @@ class drealtyMetaData {
 
   /**
    * Function to return drealtyRetsFeilds from the database
-   * 
+   *
    * @param integer $conid
    * @param drealtyRetsResource $resource
    * @param drealtyRetsClass $class
@@ -160,7 +160,8 @@ class drealtyMetaData {
               $fields[$newField->systemname] = $newField;
             }
           } // end foreach
-        } else {
+        }
+        else {
           $this->handleRetsError($dc->rets);
         }
         $dc->disconnect();
@@ -173,7 +174,7 @@ class drealtyMetaData {
   /**
    * Retreive a drealtyRetsClass from the db
    * @param integer $id
-   * @return drealtyRetsClass 
+   * @return drealtyRetsClass
    */
   public function FetchClass($id) {
     $result = db_select('drealty_classes', 'dc')
@@ -232,7 +233,8 @@ class drealtyMetaData {
               $classes[$newClass->systemname] = $newClass;
             }
           } // end foreach
-        } else {
+        }
+        else {
           $this->handleRetsError($dc->rets);
         }
         $dc->disconnect();
@@ -244,7 +246,7 @@ class drealtyMetaData {
   /**
    *
    * @param int $rid
-   * @return drealtyRetsResource 
+   * @return drealtyRetsResource
    */
   function FetchResource($rid) {
     $resource = db_select('drealty_resources', 'dr')
@@ -303,7 +305,8 @@ class drealtyMetaData {
           } // end foreach
           // set the static cache
           $cache = $resources;
-        } else {
+        }
+        else {
           $this->handleRetsError($dc->rets);
         }
         $dc->disconnect();
@@ -316,7 +319,8 @@ class drealtyMetaData {
     $result = db_result(db_query("SELECT systemName FROM {drealty_fields} WHERE correlation = '%s' AND resource = '%s' AND conid = %d", $correlation_name, $resource, $conid));
     if (!empty($result)) {
       return $result;
-    } else {
+    }
+    else {
       return FALSE;
     }
   }
@@ -325,7 +329,8 @@ class drealtyMetaData {
     $result = db_result(db_query("SELECT cck_field_name FROM {drealty_fields} WHERE correlation = '%s' AND resource = '%s' AND conid = %d", $correlation_name, $resource, $conid));
     if (!empty($result)) {
       return $result;
-    } else {
+    }
+    else {
       return FALSE;
     }
   }
@@ -453,4 +458,4 @@ class drealtyResourceMapping {
   public $rid;
   public $entity_type;
 
-}
\ No newline at end of file
+}
diff --git a/modules/drealty_lead/drealty_lead.install b/modules/drealty_lead/drealty_lead.install
index 97c1089..251fe93 100644
--- a/modules/drealty_lead/drealty_lead.install
+++ b/modules/drealty_lead/drealty_lead.install
@@ -5,116 +5,116 @@
  */
 
 function drealty_lead_install() {
-	
-	if (!field_info_field('field_drealty_lead_name')) {
-		field_create_field(array(
-			'field_name' => 'field_drealty_lead_name',
-			'locked' => TRUE,
-			'settings' => array(
-				'label' => 'Name',
-				'description' => 'The dRealty lead name (ex. John Doe).',
-			),
-			'type' => 'text',
-		));
-	}
-	
-	if (!field_info_field('field_drealty_lead_email')) {
-		field_create_field(array(
-			'field_name' => 'field_drealty_lead_email',
-			'locked' => TRUE,
-			'settings' => array(
-				'label' => 'Email Address',
-				'description' => 'The dRealty lead email address (ex. johndoe@mail.com).',
-			),
-			'type' => 'text',
-		));
-	}
-	
-	if (!field_info_field('field_drealty_lead_phone')) {
-		field_create_field(array(
-			'field_name' => 'field_drealty_lead_phone',
-			'locked' => TRUE,
-			'settings' => array(
-				'label' => 'Email Address',
-				'description' => 'The dRealty lead phone number (ex. 123-456-7890).',
-			),
-			'type' => 'text',
-		));
-	}
-	
-	if (!field_info_field('field_drealty_lead_mls_id')) {
-		field_create_field(array(
-			'field_name' => 'field_drealty_lead_mls_id',
-			'locked' => TRUE,
-			'settings' => array(
-				'label' => 'MLS ID',
-				'description' => 'The dRealty mls listing ID (ex. 567890).',
-			),
-			'type' => 'text',
-		));
-	}
-	
-	if (!field_info_field('field_drealty_lead_question')) {
-		field_create_field(array(
-			'field_name' => 'field_drealty_lead_question',
-			'locked' => TRUE,
-			'settings' => array(
-				'label' => 'Email Address',
-				'description' => 'The dRealty lead email address (ex. johndoe@mail.com).',
-			),
-			'type' => 'text_long',
-		));
-	}
-	
-	if (!field_info_instance('drealty_lead', 'field_drealty_lead_name', 'drealty_lead')) {
-		field_create_instance(array(
-			'field_name' => 'field_drealty_lead_name',
-			'label' => 'Name',
-			'description' => 'The full name of the lead.',
-			'entity_type' => 'drealty_lead',
-			'bundle' => 'drealty_lead',
-		));
-	}
-	
-	if (!field_info_instance('drealty_lead', 'field_drealty_lead_email', 'drealty_lead')) {
-		field_create_instance(array(
-			'field_name' => 'field_drealty_lead_email',
-			'label' => 'Email Address',
-			'description' => 'The email address of the lead.',
-			'entity_type' => 'drealty_lead',
-			'bundle' => 'drealty_lead',
-		));
-	}
-	
-	if (!field_info_instance('drealty_lead', 'field_drealty_lead_phone', 'drealty_lead')) {
-		field_create_instance(array(
-			'field_name' => 'field_drealty_lead_phone',
-			'label' => 'Phone Number',
-			'description' => 'The phone number of the lead.',
-			'entity_type' => 'drealty_lead',
-			'bundle' => 'drealty_lead',
-		));
-	}
-	
-	if (!field_info_instance('drealty_lead', 'field_drealty_lead_mls_id', 'drealty_lead')) {
-		field_create_instance(array(
-			'field_name' => 'field_drealty_lead_mls_id',
-			'label' => 'MLS ID',
-			'description' => 'The MLS ID this lead inquired about.',
-			'entity_type' => 'drealty_lead',
-			'bundle' => 'drealty_lead',
-		));
-	}
-	
-	if (!field_info_instance('drealty_lead', 'field_drealty_lead_question', 'drealty_lead')) {
-		field_create_instance(array(
-			'field_name' => 'field_drealty_lead_question',
-			'label' => 'Questions/Comments',
-			'description' => 'The questions/concerns this lead had about the MLS listing.',
-			'entity_type' => 'drealty_lead',
-			'bundle' => 'drealty_lead',
-		));
-	}
+
+  if (!field_info_field('field_drealty_lead_name')) {
+    field_create_field(array(
+      'field_name' => 'field_drealty_lead_name',
+      'locked' => TRUE,
+      'settings' => array(
+        'label' => 'Name',
+        'description' => 'The dRealty lead name (ex. John Doe).',
+      ),
+      'type' => 'text',
+    ));
+  }
+
+  if (!field_info_field('field_drealty_lead_email')) {
+    field_create_field(array(
+      'field_name' => 'field_drealty_lead_email',
+      'locked' => TRUE,
+      'settings' => array(
+        'label' => 'Email Address',
+        'description' => 'The dRealty lead email address (ex. johndoe@mail.com).',
+      ),
+      'type' => 'text',
+    ));
+  }
+
+  if (!field_info_field('field_drealty_lead_phone')) {
+    field_create_field(array(
+      'field_name' => 'field_drealty_lead_phone',
+      'locked' => TRUE,
+      'settings' => array(
+        'label' => 'Email Address',
+        'description' => 'The dRealty lead phone number (ex. 123-456-7890).',
+      ),
+      'type' => 'text',
+    ));
+  }
+
+  if (!field_info_field('field_drealty_lead_mls_id')) {
+    field_create_field(array(
+      'field_name' => 'field_drealty_lead_mls_id',
+      'locked' => TRUE,
+      'settings' => array(
+        'label' => 'MLS ID',
+        'description' => 'The dRealty mls listing ID (ex. 567890).',
+      ),
+      'type' => 'text',
+    ));
+  }
+
+  if (!field_info_field('field_drealty_lead_question')) {
+    field_create_field(array(
+      'field_name' => 'field_drealty_lead_question',
+      'locked' => TRUE,
+      'settings' => array(
+        'label' => 'Email Address',
+        'description' => 'The dRealty lead email address (ex. johndoe@mail.com).',
+      ),
+      'type' => 'text_long',
+    ));
+  }
+
+  if (!field_info_instance('drealty_lead', 'field_drealty_lead_name', 'drealty_lead')) {
+    field_create_instance(array(
+      'field_name' => 'field_drealty_lead_name',
+      'label' => 'Name',
+      'description' => 'The full name of the lead.',
+      'entity_type' => 'drealty_lead',
+      'bundle' => 'drealty_lead',
+    ));
+  }
+
+  if (!field_info_instance('drealty_lead', 'field_drealty_lead_email', 'drealty_lead')) {
+    field_create_instance(array(
+      'field_name' => 'field_drealty_lead_email',
+      'label' => 'Email Address',
+      'description' => 'The email address of the lead.',
+      'entity_type' => 'drealty_lead',
+      'bundle' => 'drealty_lead',
+    ));
+  }
+
+  if (!field_info_instance('drealty_lead', 'field_drealty_lead_phone', 'drealty_lead')) {
+    field_create_instance(array(
+      'field_name' => 'field_drealty_lead_phone',
+      'label' => 'Phone Number',
+      'description' => 'The phone number of the lead.',
+      'entity_type' => 'drealty_lead',
+      'bundle' => 'drealty_lead',
+    ));
+  }
+
+  if (!field_info_instance('drealty_lead', 'field_drealty_lead_mls_id', 'drealty_lead')) {
+    field_create_instance(array(
+      'field_name' => 'field_drealty_lead_mls_id',
+      'label' => 'MLS ID',
+      'description' => 'The MLS ID this lead inquired about.',
+      'entity_type' => 'drealty_lead',
+      'bundle' => 'drealty_lead',
+    ));
+  }
+
+  if (!field_info_instance('drealty_lead', 'field_drealty_lead_question', 'drealty_lead')) {
+    field_create_instance(array(
+      'field_name' => 'field_drealty_lead_question',
+      'label' => 'Questions/Comments',
+      'description' => 'The questions/concerns this lead had about the MLS listing.',
+      'entity_type' => 'drealty_lead',
+      'bundle' => 'drealty_lead',
+    ));
+  }
 }
 
 /**
@@ -122,7 +122,7 @@ function drealty_lead_install() {
  */
 
 function drealty_lead_uninstall() {
-	$leads = db_select('drealty_lead', 'lead')
+  $leads = db_select('drealty_lead', 'lead')
     ->fields('lead', array('id'))
     ->execute()
     ->fetchAllAssoc('id');
@@ -131,9 +131,9 @@ function drealty_lead_uninstall() {
   foreach ($leads as $lead) {
     entity_delete('drealty_lead', $id);
   }
-	
-	field_attach_delete_bundle('drealty_lead', 'drealty_lead');
-	field_purge_batch(10);
+
+  field_attach_delete_bundle('drealty_lead', 'drealty_lead');
+  field_purge_batch(10);
 }
 
 /**
@@ -141,16 +141,16 @@ function drealty_lead_uninstall() {
  */
 
 function drealty_lead_schema() {
-	$schema['drealty_lead'] = array(
-		'description' => 'Base table to store dRealty Leads.',
-		'fields' => array(
-			'id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'Lead primary key.'),
-			'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => 'The user who created this lead. Defaults to 1 if created by a non Drupal user.'),      
-			'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => 'Date the lead was created in the system.'),
+  $schema['drealty_lead'] = array(
+    'description' => 'Base table to store dRealty Leads.',
+    'fields' => array(
+      'id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'Lead primary key.'),
+      'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => 'The user who created this lead. Defaults to 1 if created by a non Drupal user.'),
+      'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => 'Date the lead was created in the system.'),
       'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => 'Last date the lead was changed/updated in the system'),
     ),
     'primary key' => array('id'),
-	);
-	
-	return $schema;
-}
\ No newline at end of file
+  );
+
+  return $schema;
+}
diff --git a/modules/drealty_lead/includes/drealty_lead.lead.admin.inc b/modules/drealty_lead/includes/drealty_lead.lead.admin.inc
index 5f86a8d..870bdac 100644
--- a/modules/drealty_lead/includes/drealty_lead.lead.admin.inc
+++ b/modules/drealty_lead/includes/drealty_lead.lead.admin.inc
@@ -46,7 +46,7 @@ class DrealtyLeadUIController extends EntityDefaultUIController {
       'file' => 'drealty_lead.lead.admin.inc',
       'file path' => drupal_get_path('module', $this->entityInfo['module']) . '/includes'
     );
-		
+
     // Loading and editing model entities
     $items[$this->path . '/' . $wildcard . '/edit'] = array(
       'title' => 'Edit Lead',
@@ -80,14 +80,15 @@ class DrealtyLeadUIController extends EntityDefaultUIController {
 }
 
 function drealty_lead_add_page() {
-  
+
 }
 
 function drealty_lead_admin($type = 'new') {
   $edit = $_POST;
   if (isset($edit['operation']) && ($edit['operation'] == 'delete') && isset($edit['leads']) && $edit['leads']) {
     return drupal_get_form('drealty_lead_multiple_delete_confirm');
-  } else {
+  }
+  else {
     return drupal_get_form('drealty_lead_admin_overview', $type);
   }
 }
@@ -150,7 +151,7 @@ function drealty_lead_form_wrapper($op, $lead) {
 function drealty_lead_edit_form($form, &$form_state, $op, $lead) {
 
   $form_state['lead'] = $lead;
-	
+
   field_attach_form('drealty_lead', $lead, $form, $form_state);
 
   $form['actions'] = array(
@@ -173,15 +174,15 @@ function drealty_lead_edit_form($form, &$form_state, $op, $lead) {
     '#submit' => $submit + array('drealty_lead_edit_form_submit'),
   );
 
-	if (isset($lead->id) && drealty_lead_access('delete')) {
-		$form['actions']['delete'] = array(
-			'#type' => 'submit',
-			'#value' => t('Delete lead'),
-			'#submit' => $submit + array('drealty_lead_delete_confirm'),
-			'#weight' => 45,
-		);
-	}
-	
+  if (isset($lead->id) && drealty_lead_access('delete')) {
+    $form['actions']['delete'] = array(
+      '#type' => 'submit',
+      '#value' => t('Delete lead'),
+      '#submit' => $submit + array('drealty_lead_delete_confirm'),
+      '#weight' => 45,
+    );
+  }
+
   return $form;
 }
 
@@ -200,13 +201,13 @@ function drealty_lead_edit_form_submit($form, &$form_state) {
  * Menu callback -- ask for confirmation of lead deletion
  */
 function drealty_lead_delete_confirm($form, &$form_state) {
-	if (!$form_state['lead']) {
-		$form_state['lead'] = drealty_lead_load(arg(1));
-	}
+  if (!$form_state['lead']) {
+    $form_state['lead'] = drealty_lead_load(arg(1));
+  }
   // Always provide entity id in the same form key as in the entity edit form.
   $form['lead'] = $form_state['lead'];
-  
-	return confirm_form($form,
+
+  §return confirm_form($form,
     t('Are you sure you want to delete the lead "%title"?', array('%title' => 'aaa')), 'drealty_lead/' . $form_state['lead']->id,
     t('This action cannot be undone.'),
     t('Delete'),
@@ -218,12 +219,12 @@ function drealty_lead_delete_confirm($form, &$form_state) {
  * Execute lead deletion
  */
 function drealty_lead_delete_submit($form, &$form_state) {
-	$lead = drealty_lead_load($form_state['lead']->id);
-	$lead->delete();
-	global $user;
-	watchdog('drealty_lead', '@user: deleted lead @id (@name).', array('@user' => $user->name, '@id' => $lead->id, '@name' => $lead->field_drealty_lead_name[LANGUAGE_NONE][0]['value']));
-	drupal_set_message(t('Lead ID @lead_id (@name - @mls_id) has been deleted.', array('@lead_id' => $lead->id, '@name' => $lead->field_drealty_lead_name[LANGUAGE_NONE][0]['value'], '@mls_id' => $lead->field_drealty_lead_mls_id[LANGUAGE_NONE][0]['value'])));
-	$form_state['redirect'] = 'admin/drealty/drealty-leads';
+  $lead = drealty_lead_load($form_state['lead']->id);
+  $lead->delete();
+  global $user;
+  watchdog('drealty_lead', '@user: deleted lead @id (@name).', array('@user' => $user->name, '@id' => $lead->id, '@name' => $lead->field_drealty_lead_name[LANGUAGE_NONE][0]['value']));
+  drupal_set_message(t('Lead ID @lead_id (@name - @mls_id) has been deleted.', array('@lead_id' => $lead->id, '@name' => $lead->field_drealty_lead_name[LANGUAGE_NONE][0]['value'], '@mls_id' => $lead->field_drealty_lead_mls_id[LANGUAGE_NONE][0]['value'])));
+  $form_state['redirect'] = 'admin/drealty/drealty-leads';
 }
 
 /**
@@ -241,4 +242,4 @@ function drealty_lead_view($entity, $view_mode = 'full', $langcode = NULL, $page
   $content = $controller->view(array($entity->id => $entity), $view_mode, $langcode, $page);
 
   return $content;
-}
\ No newline at end of file
+}
diff --git a/modules/drealty_lead/includes/drealty_lead.lead.inc b/modules/drealty_lead/includes/drealty_lead.lead.inc
index 2e0ae78..112b385 100644
--- a/modules/drealty_lead/includes/drealty_lead.lead.inc
+++ b/modules/drealty_lead/includes/drealty_lead.lead.inc
@@ -1,62 +1,62 @@
 <?php
 
 class DrealtyLead extends Entity {
-	
-	public $id;
-	public $uid;
-	public $created;
-	public $changed;
-	
-	public function __construct($values = array()) {
-		parent::__construct($values, 'drealty_lead');
-	}
-	
-	protected function defaultLabel() {
+
+  public $id;
+  public $uid;
+  public $created;
+  public $changed;
+
+  public function __construct($values = array()) {
+    parent::__construct($values, 'drealty_lead');
+  }
+
+  protected function defaultLabel() {
     return $this->name;
   }
 
   public function label() {
     return $this->name;
   }
-	
-	protected function defaultUri() {
+
+  protected function defaultUri() {
     return array('path' => 'drealty_lead/' . $this->id);
   }
-	
-	public function path() {
+
+  public function path() {
     $uri = $this->uri();
     return $uri['path'];
   }
-	
-	public function url() {
+
+  public function url() {
     $uri = $this->uri();
     return url($uri['path'], $uri);
   }
-	
-	public function save() {
-		if (empty($this->created) && (!empty($this->is_new) || !$this->id)) {
+
+  public function save() {
+    if (empty($this->created) && (!empty($this->is_new) || !$this->id)) {
       $this->created = REQUEST_TIME;
     }
-		
-		if (empty($this->uid)) {
-			global $user;
-			$this->uid = $user->uid;
-		}
-		
+
+    if (empty($this->uid)) {
+      global $user;
+      $this->uid = $user->uid;
+    }
+
     $this->changed = REQUEST_TIME;
 
     parent::save();
   }
-	
-	public function delete() {
+
+  public function delete() {
     parent::delete();
   }
 }
 
 class DrealtyLeadController extends EntityAPIController {
-	
-	/**
-   * @param type $entityType 
+
+  /**
+   * @param type $entityType
    */
   public function __construct($entityType) {
     parent::__construct($entityType);
@@ -68,14 +68,14 @@ class DrealtyLeadController extends EntityAPIController {
    * @param type $view_mode
    * @param type $langcode
    * @param type $content
-   * @return string 
+   * @return string
    */
   public function buildContent($entity, $view_mode = 'full', $langcode = NULL, $content = array()) {
     $content = parent::buildContent($entity, $view_mode, $langcode, $content);
     return $content;
   }
-	
-	public function create(array $values = array()) {
+
+  public function create(array $values = array()) {
     $entity = parent::create($values);
     return $entity;
   }
@@ -83,12 +83,12 @@ class DrealtyLeadController extends EntityAPIController {
   public function save($entity, DatabaseTransaction $transaction = NULL) {
     parent::save($entity, $transaction);
   }
-	
-	public function delete($ids, DatabaseTransaction $transaction = NULL) {
+
+  public function delete($ids, DatabaseTransaction $transaction = NULL) {
 
     $entities = $ids ? $this->load($ids) : FALSE;
-    
-		if (!$entities) {
+
+    if (!$entities) {
       // Do nothing, in case invalid or no ids have been passed.
       return;
     }
diff --git a/plugins/geocoder_handler/drealty.google.inc b/plugins/geocoder_handler/drealty.google.inc
index f4e4a65..1b46487 100644
--- a/plugins/geocoder_handler/drealty.google.inc
+++ b/plugins/geocoder_handler/drealty.google.inc
@@ -55,7 +55,8 @@ function drealty_geocoder_google($address, $options = array()) {
       // Construct a geoPHP Geometry depending on what type of geometry we want returned (defaults to point)
       if (!isset($options['geometry_type']) || $options['geometry_type'] == 'point') {
         $geom = new Point($item->geometry->location->lng, $item->geometry->location->lat);
-      } elseif ($options['geometry_type'] == 'bounds') {
+      }
+      elseif ($options['geometry_type'] == 'bounds') {
         $points = array(
           new Point($item->geometry->bounds->southwest->lng, $item->geometry->bounds->southwest->lat),
           new Point($item->geometry->bounds->southwest->lng, $item->geometry->bounds->northeast->lat),
@@ -64,7 +65,8 @@ function drealty_geocoder_google($address, $options = array()) {
           new Point($item->geometry->bounds->southwest->lng, $item->geometry->bounds->southwest->lat),
         );
         $geom = new Polygon(array(new LineString($points)));
-      } elseif ($options['geometry_type'] == 'viewport') {
+      }
+      elseif ($options['geometry_type'] == 'viewport') {
         $points = array(
           new Point($item->geometry->viewport->southwest->lng, $item->geometry->viewport->southwest->lat),
           new Point($item->geometry->viewport->southwest->lng, $item->geometry->viewport->northeast->lat),
@@ -87,7 +89,7 @@ function drealty_geocoder_google($address, $options = array()) {
     if (empty($geometries))
       return;
 
-    // Check if we should return all results as a compound geometry  
+    // Check if we should return all results as a compound geometry
     if (isset($options['all_results'])) {
       if ($options['all_results']) {
         return geoPHP::geometryReduce($geometries);
