diff --git a/ShareThisForm.js b/ShareThisForm.js
index 583827f..9c1b63c 100644
--- a/ShareThisForm.js
+++ b/ShareThisForm.js
@@ -7,65 +7,65 @@
 var drupal_st = {
   // These are handlerd for updating the widget pic class.
   multiW: function () {
-    jQuery(".st_widgetPic").addClass("st_multi");
+    jQuery('.st_widgetPic').addClass('st_multi');
   },
   classicW: function () {
-    jQuery(".st_widgetPic").removeClass("st_multi");
+    jQuery('.st_widgetPic').removeClass('st_multi');
   },
   // These are the handlers for updating the button pic class (stbc = sharethisbuttonclass).
   smallChicklet: function () {
     drupal_st.removeButtonClasses();
-    jQuery("#stb_sprite").addClass("stbc_");
+    jQuery('#stb_sprite').addClass('stbc_');
   },
   largeChicklet: function () {
     drupal_st.removeButtonClasses();
-    jQuery("#stb_sprite").addClass("stbc_large");
+    jQuery('#stb_sprite').addClass('stbc_large');
   },
   hcount: function () {
     drupal_st.removeButtonClasses();
-    jQuery("#stb_sprite").addClass("stbc_hcount");
+    jQuery('#stb_sprite').addClass('stbc_hcount');
   },
   vcount: function () {
     drupal_st.removeButtonClasses();
-    jQuery("#stb_sprite").addClass("stbc_vcount");
+    jQuery('#stb_sprite').addClass('stbc_vcount');
   },
   button: function () {
     drupal_st.removeButtonClasses();
-    jQuery("#stb_sprite").addClass("stbc_button");
+    jQuery('#stb_sprite').addClass('stbc_button');
   },
   // This is a helper function for updating button pictures.
   removeButtonClasses: function () {
-    var toRemove = jQuery("#stb_sprite");
-    toRemove.removeClass("stbc_");
-    toRemove.removeClass("stbc_large");
-    toRemove.removeClass("stbc_hcount");
-    toRemove.removeClass("stbc_vcount");
-    toRemove.removeClass("stbc_button");
+    var toRemove = jQuery('#stb_sprite');
+    toRemove.removeClass('stbc_');
+    toRemove.removeClass('stbc_large');
+    toRemove.removeClass('stbc_hcount');
+    toRemove.removeClass('stbc_vcount');
+    toRemove.removeClass('stbc_button');
   },
   // Write helper functions for saving:
   getWidget: function () {
-    return jQuery(".st_widgetPic").hasClass("st_multiW") ? '5x' : '4x';
+    return jQuery('.st_widgetPic').hasClass('st_multiW') ? '5x' : '4x';
   },
   getButtons: function () {
     var selectedButton = 'large';
-    var buttonButtons = jQuery(".st_wIm");
+    var buttonButtons = jQuery('.st_wIm');
     buttonButtons.each(function () {
-      if (jQuery(this).hasClass("st_select")) {
-        selectedButton = jQuery(this).attr("id").substring(3);
+      if (jQuery(this).hasClass('st_select')) {
+        selectedButton = jQuery(this).attr('id').substring(3);
       }
     });
     console.log(selectedButton);
     return selectedButton;
   },
   setupServiceText: function () {
-    jQuery("#edit-sharethis-service-option").css({display:"none"});
+    jQuery('#edit-sharethis-service-option').css({display:"none"});
 
     if (jQuery('input[name=sharethis_callesi]').val() == 1) {
-      // alert("esi called");.
+      // alert('esi called');.
       drupal_st.getGlobalCNSConfig();
     }
     else {
-      // alert("settings found");.
+      // alert('settings found');.
     }
   },
   odjs: function (scriptSrc,callBack) {
@@ -76,7 +76,7 @@ var drupal_st = {
     this.script.setAttribute('src', this.scriptSrc);
     this.script.onload = callBack;
     this.script.onreadystatechange = function () {
-      if (this.readyState == "complete" || (scriptSrc.indexOf("checkOAuth.esi") != -1 && this.readyState == "loaded")) {
+      if (this.readyState == "complete" || (scriptSrc.indexOf('checkOAuth.esi') != -1 && this.readyState == 'loaded')) {
         callBack();
       }
     };
@@ -84,7 +84,7 @@ var drupal_st = {
   },
   getGlobalCNSConfig: function () {
     try {
-      drupal_st.odjs((("https:" == document.location.protocol) ? "https://wd-edge.sharethis.com/button/getDefault.esi?cb=drupal_st.cnsCallback" : "http://wd-edge.sharethis.com/button/getDefault.esi?cb=drupal_st.cnsCallback"));
+      drupal_st.odjs((('https:' == document.location.protocol) ? "https://wd-edge.sharethis.com/button/getDefault.esi?cb=drupal_st.cnsCallback" : 'http://wd-edge.sharethis.com/button/getDefault.esi?cb=drupal_st.cnsCallback'));
     }
     catch (err) {
       drupal_st.cnsCallback(err);
@@ -95,34 +95,34 @@ var drupal_st = {
   },
   // Function to add various events to our html form elements.
   addEvents: function () {
-    jQuery("#edit-sharethis-widget-option-st-multi").click(drupal_st.multiW);
-    jQuery("#edit-sharethis-widget-option-st-direct").click(drupal_st.classicW);
+    jQuery('#edit-sharethis-widget-option-st-multi').click(drupal_st.multiW);
+    jQuery('#edit-sharethis-widget-option-st-direct').click(drupal_st.classicW);
 
-    jQuery("#edit-sharethis-button-option-stbc-").click(drupal_st.smallChicklet);
-    jQuery("#edit-sharethis-button-option-stbc-large").click(drupal_st.largeChicklet);
-    jQuery("#edit-sharethis-button-option-stbc-hcount").click(drupal_st.hcount);
-    jQuery("#edit-sharethis-button-option-stbc-vcount").click(drupal_st.vcount);
-    jQuery("#edit-sharethis-button-option-stbc-button").click(drupal_st.button);
+    jQuery('#edit-sharethis-button-option-stbc-').click(drupal_st.smallChicklet);
+    jQuery('#edit-sharethis-button-option-stbc-large').click(drupal_st.largeChicklet);
+    jQuery('#edit-sharethis-button-option-stbc-hcount').click(drupal_st.hcount);
+    jQuery('#edit-sharethis-button-option-stbc-vcount').click(drupal_st.vcount);
+    jQuery('#edit-sharethis-button-option-stbc-button').click(drupal_st.button);
 
-    jQuery(".st_formButtonSave").click(drupal_st.updateOptions);
+    jQuery('.st_formButtonSave').click(drupal_st.updateOptions);
 
     jQuery('#st_cns_settings').find('input').live('click', drupal_st.updateDoNotHash);
   },
   serviceCallback: function () {
-    var services = stlib_picker.getServices("myPicker");
+    var services = stlib_picker.getServices('myPicker');
     var outputString = "";
     for (i = 0; i < services.length; i++) {
       outputString += "\"" + _all_services[services[i]].title + ":"
       outputString += services[i] + "\","
     }
     outputString = outputString.substring(0, outputString.length - 1);
-    jQuery("#edit-sharethis-service-option").attr("value", outputString);
+    jQuery('#edit-sharethis-service-option').attr('value', outputString);
   },
   to_boolean: function (str) {
     return str === true || jQuery.trim(str).toLowerCase() === 'true';
   },
   cnsCallback: function (response) {
-    if ((response instanceof Error) || (response == "" || (typeof(response) == "undefined"))) {
+    if ((response instanceof Error) || (response == "" || (typeof(response) == 'undefined'))) {
       // Setting default config.
       response = '{"doNotHash": true, "doNotCopy": true, "hashAddressBar": false}';
       response = jQuery.parseJSON(response);
@@ -134,23 +134,23 @@ var drupal_st = {
       hashAddressBar: drupal_st.to_boolean(response.hashAddressBar)
     };
 
-    if (obj.doNotHash == false || obj.doNotHash === "false") {
-      if (obj.doNotCopy === true || obj.doNotCopy == "true") {
-        jQuery(jQuery('#st_cns_settings').find('input')[0]).removeAttr("checked");
+    if (obj.doNotHash == false || obj.doNotHash === 'false') {
+      if (obj.doNotCopy === true || obj.doNotCopy == 'true') {
+        jQuery(jQuery('#st_cns_settings').find('input')[0]).removeAttr('checked');
       }
       else {
-        jQuery(jQuery('#st_cns_settings').find('input')[0]).attr("checked",true);
+        jQuery(jQuery('#st_cns_settings').find('input')[0]).attr('checked',true);
       }
-      if (obj.hashAddressBar === true || obj.hashAddressBar == "true") {
-        jQuery(jQuery('#st_cns_settings').find('input')[1]).attr("checked",true);
+      if (obj.hashAddressBar === true || obj.hashAddressBar == 'true') {
+        jQuery(jQuery('#st_cns_settings').find('input')[1]).attr('checked',true);
       }
       else {
-        jQuery(jQuery('#st_cns_settings').find('input')[1]).removeAttr("checked");
+        jQuery(jQuery('#st_cns_settings').find('input')[1]).removeAttr('checked');
       }
     }
     else {
       jQuery('#st_cns_settings').find('input').each(function (index) {
-        jQuery(this).removeAttr("checked");
+        jQuery(this).removeAttr('checked');
       });
     }
   }
diff --git a/plugins/content_types/sharethis/sharethis.inc b/plugins/content_types/sharethis/sharethis.inc
index 318faf9..ef6113b 100644
--- a/plugins/content_types/sharethis/sharethis.inc
+++ b/plugins/content_types/sharethis/sharethis.inc
@@ -18,6 +18,9 @@ $plugin = array(
   ),
 );
 
+/**
+ * Implements sharethis_sharethis_content_type_render().
+ */
 function sharethis_sharethis_content_type_render($subtype, $conf, $panel_args, $context) {
   if (!empty($context[0])) {
     $entity_type = end($context[0]->type);
@@ -36,7 +39,7 @@ function sharethis_sharethis_content_type_render($subtype, $conf, $panel_args, $
   }
 
   $block = new stdClass();
-  $block->module  = 'sharethis';
+  $block->module = 'sharethis';
   $block->content = theme('sharethis', array(
     'data_options' => sharethis_get_options_array(),
     'm_path' => $url,
@@ -46,6 +49,9 @@ function sharethis_sharethis_content_type_render($subtype, $conf, $panel_args, $
   return $block;
 }
 
+/**
+ * Implements sharethis_sharethis_content_type_edit_form().
+ */
 function sharethis_sharethis_content_type_edit_form($form, &$form_state) {
   $conf = $form_state['conf'];
   $description = t('Context or Global - Use context if available or default to Global.');
@@ -87,3 +93,4 @@ function sharethis_sharethis_content_type_edit_form_submit($form, &$form_state)
     $form_state['conf'][$key] = $form_state['values'][$key];
   }
 }
+
diff --git a/sharethis.admin.inc b/sharethis.admin.inc
index 189f755..a4c680c 100644
--- a/sharethis.admin.inc
+++ b/sharethis.admin.inc
@@ -1,12 +1,13 @@
 <?php
+
 /**
  * @file
  * Functionality for Share This administration.
  */
 
- /**
-  * This is the main configuration form for the admin page.
-  */
+/**
+ * This is the main configuration form for the admin page.
+ */
 function sharethis_configuration_form($form, &$form_state) {
   // First, setup variables we will need.
   // Get the path variables setup.
@@ -22,19 +23,13 @@ function sharethis_configuration_form($form, &$form_state) {
   $current_options_array = sharethis_get_options_array();
   global $base_url;
 
-  // Create the variables related to widget choice.
-  $widget_type = $current_options_array['widget'];
-  $widget_markup = "";
-  if ($widget_type == "st_multi") {
-    $widget_markup = "st_multi";
-  }
   // Create the variables related to button choice.
   $button_choice = check_plain($current_options_array['buttons']);
   // Create the variables related to services chosen.
   $service_string = $current_options_array['services'];
   $service_string_markup = "";
   $enabled_services = array();
-  foreach (explode(",", $service_string) as $name => $string) {
+  foreach (explode(",", $service_string) as $string) {
     $key = explode(":", drupal_substr($string, 0, -1));
     $key = $key[1];
     $service_string_markup .= "\"" . $key . "\",";
@@ -251,8 +246,7 @@ function sharethis_configuration_form($form, &$form_state) {
     '#description' => t('The weight of the widget determines the location on the page where it will appear.'),
     '#required' => FALSE,
     '#type' => 'select',
-    '#options' => drupal_map_assoc(array(
-      -100, -50, -25, -10, 0, 10, 25, 50, 100,
+    '#options' => drupal_map_assoc(array(-100, -50, -25, -10, 0, 10, 25, 50, 100,
     )),
     '#default_value' => variable_get('sharethis_weight', 10),
   );
@@ -335,11 +329,11 @@ function sharethis_configuration_form($form, &$form_state) {
     '#type' => 'checkboxes',
     '#prefix' => '<div id="st_cns_settings">',
     '#suffix' => '</div><div class="st_cns_container">
-        <p>CopyNShare is the new ShareThis widget feature that enables you to track the shares that occur when a user copies and pastes your website\'s <u>URL</u> or <u>Content</u>. <br/>
-        <u>Site URL</u> - ShareThis adds a special #hashtag at the end of your address bar URL to keep track of where your content is being shared on the web.<br/>
-        <u>Site Content</u> - It enables the pasting of "See more: YourURL#SThashtag" after user copies-and-pastes text. When a user copies text within your site, a "See more: yourURL.com#SThashtag" will appear after the pasted text. <br/>
-        Please refer the <a href="http://support.sharethis.com/customer/portal/articles/517332-share-widget-faqs#copynshare" target="_blank">CopyNShare FAQ</a> for more details.</p>
-      </div>',
+    <p>CopyNShare is the new ShareThis widget feature that enables you to track the shares that occur when a user copies and pastes your website\'s <u>URL</u> or <u>Content</u>. <br/>
+      <u>Site URL</u> - ShareThis adds a special #hashtag at the end of your address bar URL to keep track of where your content is being shared on the web.<br/>
+      <u>Site Content</u> - It enables the pasting of "See more: YourURL#SThashtag" after user copies-and-pastes text. When a user copies text within your site, a "See more: yourURL.com#SThashtag" will appear after the pasted text. <br/>
+      Please refer the <a href="http://support.sharethis.com/customer/portal/articles/517332-share-widget-faqs#copynshare" target="_blank">CopyNShare FAQ</a> for more details.</p>
+    </div>',
     '#options' => array(
       'donotcopy' => t("Measure copy & shares of your site\'s Content"),
       'hashaddress' => t("Measure copy & shares of your site\'s URLs"),
@@ -399,3 +393,4 @@ function sharethis_configuration_form_validate($form, &$form_state) {
   // Ensure default value for twitter recommends.
   $form_state['values']['sharethis_twitter_recommends'] = (isset($form_state['values']['sharethis_twitter_recommends'])) ? $form_state['values']['sharethis_twitter_recommends'] : '';
 }
+
diff --git a/sharethis.install b/sharethis.install
index 07dc6ae..d35541d 100644
--- a/sharethis.install
+++ b/sharethis.install
@@ -32,9 +32,7 @@ function sharethis_create_publisher_key() {
  * Implements hook_uninstall().
  */
 function sharethis_uninstall() {
-  db_delete('variable')
-    ->condition('name', db_like('sharethis_') . '%', 'LIKE')
-    ->execute();
+  db_delete('variable')->condition('name', db_like('sharethis_') . '%', 'LIKE')->execute();
   cache_clear_all('variables', 'cache');
 }
 
@@ -45,9 +43,7 @@ function sharethis_update_7001() {
   // Move from the st_table to the variables table.
   if (db_table_exists('st_table')) {
     // Select all options in the ShareThis table.
-    $result = db_select('st_table', 's')
-      ->fields('s', array('st_option', 'st_value'))
-      ->execute();
+    $result = db_select('st_table', 's')->fields('s', array('st_option', 'st_value'))->execute();
     while ($record = $result->fetchAssoc()) {
       // Variable name switches. publisherID stays the same.
       switch ($record['st_option']) {
@@ -81,3 +77,4 @@ function sharethis_update_7001() {
     return t('Switched from the custom ShareThis table to the Variables table.');
   }
 }
+
diff --git a/sharethis.module b/sharethis.module
index a83d31e..592b6ee 100644
--- a/sharethis.module
+++ b/sharethis.module
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * A module that adds one of the ShareThis widget to your website.
@@ -15,11 +16,10 @@
  *   Array that holds the current path as returned from arg() function
  */
 function sharethis_help($path, $arg) {
-  global $base_url;
   switch ($path) {
     case 'admin/config/services/sharethis':
       return '<p>' . t('Choose the widget, button family, and services for using <a href="@sharethis">ShareThis</a> to share content online.', array('@sharethis' => 'http://www.sharethis.com')) . '</p>';
-      break;
+
     case "admin/help#sharethis":
       $return_value = "<p>" . t("This plugin places the ShareThis widget on each node.") . '</p>';
       $return_value .= "<ul><li>" . t("The Block pulls the URL from the current page and current Drupal title, the node version pulls it from the node title and url.") . '</li>';
@@ -28,22 +28,21 @@ function sharethis_help($path, $arg) {
       $return_value .= "<p>" . t('For various configuration options please got to <a href="@sharethis">the settings page</a>.', array('@sharethis' => url('admin/config/services/sharethis'))) . '</p>';
       $return_value .= '<p>' . t('For more information, please visit <a href="@help">support.sharethis.com</a>.', array('@help' => 'http://support.sharethis.com/customer/portal/articles/446621-drupal-integration')) . '</p>';
       return $return_value;
-      break;
   }
 }
 
 /**
  * Converts given value to boolean.
  *
- *
  * @param val
  *   Which value to convert to boolean
  */
-function to_boolean($val) {
+function sharethis_to_boolean($val) {
   if (strtolower(trim($val)) === 'false') {
-    return false;
-  } else {
-    return (boolean)$val;
+    return FALSE;
+  }
+  else {
+    return (boolean) $val;
   }
 }
 
@@ -71,7 +70,7 @@ function sharethis_configuration_form_submit($form, &$form_state) {
   }
   // Markup overrides for each enabled service.
   $enabled_services = array();
-  foreach (explode(",", $form_state['values']['sharethis_service_option']) as $name => $string) {
+  foreach (explode(",", $form_state['values']['sharethis_service_option']) as $string) {
     $service = explode(":", drupal_substr($string, 0, -1));
     $enabled_services[$service[1]] = str_replace('"', '', $service[0]);
   }
@@ -81,7 +80,7 @@ function sharethis_configuration_form_submit($form, &$form_state) {
   }
 }
 
- /**
+/**
  * Implements hook_menu().
  *
  * This is the ShareThis Config Menu.
@@ -98,7 +97,7 @@ function sharethis_menu() {
   return $items;
 }
 
- /**
+/**
  * Implements hook_node_view().
  *
  * Inserts ShareThis widget code onto each node view.
@@ -134,12 +133,17 @@ function sharethis_node_view($node, $view_mode, $langcode) {
         $display_settings = field_extra_fields_get_display('node', $node->type, $view_mode);
         if (isset($display_settings['sharethis']) && $display_settings['sharethis']['visible']) {
           $node->content['sharethis'] = array(
-            '#tag' => 'div', // Wrap it in a div.
+            // Wrap it in a div.
+            '#tag' => 'div',
             '#type' => 'html_tag',
             '#attributes' => array(
               'class' => array('sharethis-buttons'),
             ),
-            '#value' => theme('sharethis', array('data_options' => $data_options, 'm_path' => $mPath, 'm_title' => $mTitle)),
+            '#value' => theme('sharethis', array(
+              'data_options' => $data_options,
+              'm_path' => $mPath,
+              'm_title' => $mTitle)
+            ),
             '#weight' => intval(variable_get('sharethis_weight', 10)),
           );
 
@@ -147,13 +151,17 @@ function sharethis_node_view($node, $view_mode, $langcode) {
           sharethis_include_js();
         }
       }
-    break;
+      break;
+
     case 'links':
       $enabled_view_modes = variable_get('sharethis_' . $node->type . '_options', array());
       if (isset($enabled_view_modes[$view_mode]) && $enabled_view_modes[$view_mode]) {
         $links['sharethis'] = array(
           'html' => TRUE,
-          'title' => theme('sharethis', array('data_options' => $data_options, 'm_path' => $mPath, 'm_title' => $mTitle)),
+          'title' => theme('sharethis', array(
+            'data_options' => $data_options,
+            'm_path' => $mPath,
+            'm_title' => $mTitle)),
           '#attributes' => array(
             'class' => array('sharethis-buttons'),
           ),
@@ -164,15 +172,16 @@ function sharethis_node_view($node, $view_mode, $langcode) {
           '#attributes' => array(
             'class' => array('links', 'inline'),
           ),
-          '#tag' => 'div', // Wrap it in a div.
+          // Wrap it in a div.
+          '#tag' => 'div',
           '#type' => 'html_tag',
           '#weight' => intval(variable_get('sharethis_weight', 10)),
         );
 
         // Include necessary js files.
         sharethis_include_js();
-       }
-    break;
+      }
+      break;
   }
 }
 
@@ -192,8 +201,8 @@ function sharethis_field_extra_fields() {
           'weight' => intval(variable_get('sharethis_weight', 10)),
         ),
       );
-     }
-   }
+    }
+  }
   return $extra;
 }
 
@@ -213,31 +222,33 @@ function sharethis_theme($existing, $type, $theme, $path) {
 }
 
 /**
-* get_stLight_options() function is creating options to be passed to stLight.options
-* $data_options array is the settings selected by publisher in admin panel
-*/
-function get_stLight_options($data_options)
-{
-	// Provide the publisher ID.
-	$paramsStLight = array(
-		'publisher' => $data_options['publisherID'],
-	);
-	$paramsStLight['version'] = ($data_options['widget'] == 'st_multi') ? "5x" : "4x";
-	if($data_options['sharethis_callesi'] == 0){
-		$paramsStLight["doNotCopy"] = !to_boolean($data_options['sharethis_cns']['donotcopy']);
-		$paramsStLight["hashAddressBar"] = to_boolean($data_options['sharethis_cns']['hashaddress']);
-		if(!($paramsStLight["hashAddressBar"]) && $paramsStLight["doNotCopy"]){
-			$paramsStLight["doNotHash"] = TRUE;
-		}else{
-			$paramsStLight["doNotHash"] = FALSE;
-		}
-	}
-	if (isset($data_options['onhover']) && $data_options['onhover'] == FALSE) {
-	   $paramsStLight['onhover'] = FALSE;
-	}
-    if ($data_options['neworzero']) {
-      $paramsStLight['newOrZero'] = "zero";
+ * Implements sharethis_get_light_options().
+ *
+ * Function sharethis_get_light_options() is creating options to be passed to stLight.options
+ * $data_options array is the settings selected by publisher in admin panel.
+ */
+function sharethis_get_light_options($data_options) {
+  // Provide the publisher ID.
+  $paramsStLight = array(
+    'publisher' => $data_options['publisherID'],
+  );
+  $paramsStLight['version'] = ($data_options['widget'] == 'st_multi') ? "5x" : "4x";
+  if ($data_options['sharethis_callesi'] == 0) {
+    $paramsStLight["doNotCopy"] = !sharethis_to_boolean($data_options['sharethis_cns']['donotcopy']);
+    $paramsStLight["hashAddressBar"] = sharethis_to_boolean($data_options['sharethis_cns']['hashaddress']);
+    if (!($paramsStLight["hashAddressBar"]) && $paramsStLight["doNotCopy"]) {
+      $paramsStLight["doNotHash"] = TRUE;
     }
+    else {
+      $paramsStLight["doNotHash"] = FALSE;
+    }
+  }
+  if (isset($data_options['onhover']) && $data_options['onhover'] == FALSE) {
+    $paramsStLight['onhover'] = FALSE;
+  }
+  if ($data_options['neworzero']) {
+    $paramsStLight['newOrZero'] = "zero";
+  }
   if (!$data_options['shorten']) {
     $paramsStLight['shorten'] = 'false';
   }
@@ -245,7 +256,7 @@ function get_stLight_options($data_options)
     $paramsStLight['servicePopup'] = TRUE;
   }
 
-  //Let sharethis be able to detect current language, just workaround.
+  // Let sharethis be able to detect current language, just workaround.
   global $language;
   $paramsStLight['lang'] = $language->language;
   $stlight = drupal_json_encode($paramsStLight);
@@ -253,14 +264,14 @@ function get_stLight_options($data_options)
 }
 
 /**
- * sharethisGetOptionArray is a helper function for DB access.
+ * Implements sharethis_get_options_array().
  *
  * Returns options that have been stored in the database.
  *
  * @TODO: Switch from this function to just straight variable_get() calls.
  */
 function sharethis_get_options_array() {
-  $default_sharethis_nodetypes = array("article"=>"article", "page"=>"page");
+  $default_sharethis_nodetypes = array("article" => "article", "page" => "page");
   $view_modes = array();
   foreach (array_keys(node_type_get_types()) as $type) {
     $view_modes[$type] = variable_get('sharethis_' . $type . '_options', $default_sharethis_nodetypes);
@@ -269,7 +280,7 @@ function sharethis_get_options_array() {
     'buttons' => variable_get('sharethis_button_option', 'stbc_button'),
     'publisherID' => variable_get('sharethis_publisherID', ''),
     'services' => variable_get('sharethis_service_option', '"Facebook:facebook","Tweet:twitter","LinkedIn:linkedin","Email:email","ShareThis:sharethis","Pinterest:pinterest"'),
-    'option_extras' => variable_get('sharethis_option_extras', array("Google Plus One:plusone"=>"Google Plus One:plusone", "Facebook Like:fblike"=>"Facebook Like:fblike")),
+    'option_extras' => variable_get('sharethis_option_extras', array("Google Plus One:plusone" => "Google Plus One:plusone", "Facebook Like:fblike" => "Facebook Like:fblike")),
     'widget' => variable_get('sharethis_widget_option', 'st_multi'),
     'onhover' => variable_get('sharethis_option_onhover', TRUE),
     'neworzero' => variable_get('sharethis_option_neworzero', FALSE),
@@ -279,9 +290,9 @@ function sharethis_get_options_array() {
     'twitter_recommends' => variable_get('sharethis_twitter_recommends', ''),
     'late_load' => variable_get('sharethis_late_load', FALSE),
     'view_modes' => $view_modes,
-    'sharethis_cns' => variable_get('sharethis_cns',array('donotcopy'=>'0','hashaddress'=>'0')),
-	  'sharethis_callesi' => (NULL == variable_get('sharethis_cns'))?1:0,
-	  'sharethis_node_types' => variable_get('sharethis_node_types', $default_sharethis_nodetypes),
+    'sharethis_cns' => variable_get('sharethis_cns', array('donotcopy' => '0', 'hashaddress' => '0')),
+    'sharethis_callesi' => (NULL == variable_get('sharethis_cns')) ? 1 : 0,
+    'sharethis_node_types' => variable_get('sharethis_node_types', $default_sharethis_nodetypes),
     'shorten' => variable_get('sharethis_option_shorten', TRUE),
     'servicePopup' => variable_get('sharethis_option_servicepopup', FALSE),
     'fastshare' => variable_get('sharethis_fastshare', TRUE),
@@ -319,7 +330,8 @@ function theme_sharethis($variables) {
     $data_options['services'] .= ',"' . $service . '"';
   }
 
-  // The share buttons are simply spans of the form class='st_SERVICE_BUTTONTYPE' -- "st" stands for ShareThis.
+  // The share buttons are simply spans of the form
+  // class='st_SERVICE_BUTTONTYPE' -- "st" stands for ShareThis.
   $type = drupal_substr($data_options['buttons'], 4);
   $type = $type == "_" ? "" : check_plain($type);
   $service_array = explode(",", $data_options['services']);
@@ -342,9 +354,11 @@ function theme_sharethis($variables) {
     switch ($serviceCodeName) {
       case 'twitter':
         // Append Prefix.
-        $title = !empty($data_options['twitter_prefix']) ? $data_options['twitter_prefix'] . ' ' . $title : $title;
+        $title = !empty($data_options['twitter_prefix']) ?
+        $data_options['twitter_prefix'] . ' ' . $title : $title;
         // Append Suffix.
-        $title = !empty($data_options['twitter_suffix']) ? $title . ' ' . $data_options['twitter_suffix'] : $title;
+        $title = !empty($data_options['twitter_suffix']) ?
+        $title . ' ' . $data_options['twitter_suffix'] : $title;
         // Check plain.
         $title = check_plain($title);
         break;
@@ -368,21 +382,25 @@ function theme_sharethis($variables) {
     }
     switch ($serviceCodeName) {
       case 'fbsub':
-        $attributes['st_username']=variable_get('sharethis_option_extras_fbsub_field', '');
-      break;
+        $attributes['st_username'] = variable_get('sharethis_option_extras_fbsub_field', '');
+        break;
+
       case 'pinterestfollow':
-        $attributes['st_username']=variable_get('sharethis_option_extras_pinterestfollow_field', '');
-      break;
+        $attributes['st_username'] = variable_get('sharethis_option_extras_pinterestfollow_field', '');
+        break;
+
       case 'twitterfollow':
-        $attributes['st_username']=variable_get('sharethis_option_extras_twitterfollow_field', '');
-      break;
+        $attributes['st_username'] = variable_get('sharethis_option_extras_twitterfollow_field', '');
+        break;
+
       case 'youtube':
-        $attributes['st_username']=variable_get('sharethis_option_extras_youtube_field', '');
-      break;
+        $attributes['st_username'] = variable_get('sharethis_option_extras_youtube_field', '');
+        break;
+
       case 'foursquarefollow':
-        $attributes['st_username']=variable_get('sharethis_option_extras_foursquarefollow_field', '');
-        $attributes['st_followId']=variable_get('sharethis_option_extras_foursquarefollow_field2', '');
-      break;
+        $attributes['st_username'] = variable_get('sharethis_option_extras_foursquarefollow_field', '');
+        $attributes['st_followId'] = variable_get('sharethis_option_extras_foursquarefollow_field2', '');
+        break;
     }
 
     // Only show the display text if the type is set.
@@ -392,15 +410,14 @@ function theme_sharethis($variables) {
     $markup = variable_get('sharethis_override_' . $serviceCodeName, '');
     // Render the span tag.
     $st_spans .= theme('html_tag', array(
-      'element' => array(
-        '#tag' => 'span',
-        '#attributes' => $attributes,
-        '#value' => $markup,
-      ),
-    ));
+        'element' => array(
+          '#tag' => 'span',
+          '#attributes' => $attributes,
+          '#value' => $markup,
+        ),
+      ));
   }
 
-
   // Output the embedded JavaScript.
   // sharethis_include_js();
   return '<div class="sharethis-wrapper">' . $st_spans . '</div>';
@@ -428,15 +445,16 @@ function sharethis_include_js() {
     }
     drupal_add_js($st_js, 'inline');
 
-	if((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')) {
-		$external = "https://ws.sharethis.com/button/buttons.js";
-	} else {
-		$external = "http://w.sharethis.com/button/buttons.js";
-	}
+    if ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')) {
+      $external = "https://ws.sharethis.com/button/buttons.js";
+    }
+    else {
+      $external = "http://w.sharethis.com/button/buttons.js";
+    }
 
     drupal_add_js($external, 'external');
 
-    $stlight = get_stLight_options($data_options);
+    $stlight = sharethis_get_light_options($data_options);
     $st_js = "if (typeof stLight !== 'undefined') { stLight.options($stlight); }";
     drupal_add_js($st_js, 'inline');
 
@@ -444,6 +462,7 @@ function sharethis_include_js() {
   }
   return $has_run;
 }
+
 /**
  * Implements hook_block_info().
  */
@@ -458,7 +477,7 @@ function sharethis_block_info() {
 /**
  * Implements of hook_block_view().
  */
-function sharethis_block_view($delta='') {
+function sharethis_block_view($delta = '') {
   $block = array();
   switch ($delta) {
     case 'sharethis_block':
@@ -469,8 +488,10 @@ function sharethis_block_view($delta='') {
 }
 
 /**
- * custom html block
+ * Implements of sharethis_block_contents().
+ *
  * @return string
+ * Returns cached contentfor block
  */
 function sharethis_block_contents() {
   if (variable_get('sharethis_location', 'content') == 'block') {
@@ -492,7 +513,11 @@ function sharethis_block_contents() {
       }
       $mPath = url($path, array('absolute' => TRUE));
       $mTitle = decode_entities(drupal_get_title());
-      $content = theme('sharethis', array('data_options' => $data_options, 'm_path' => $mPath, 'm_title' => $mTitle));
+      $content = theme('sharethis',array(
+        'data_options' => $data_options,
+        'm_path' => $mPath,
+        'm_title' => $mTitle)
+      );
       // Cache the content temporarily.
       cache_set($cache_name, $content, 'cache_block', CACHE_TEMPORARY);
       return $content;
@@ -506,13 +531,15 @@ function sharethis_block_contents() {
 function sharethis_comment_view($comment, $view_mode, $langcode) {
   if (variable_get('sharethis_comments', FALSE)) {
     $data_options = sharethis_get_options_array();
-    $path = isset($_GET['q']) ? $_GET['q'] : '<front>';
     $mPath = url($_GET['q'], array(
-      'absolute' => TRUE,
-      'fragment' => 'comment-' . $comment->cid,
-    ));
+        'absolute' => TRUE,
+        'fragment' => 'comment-' . $comment->cid,
+      ));
     $mTitle = decode_entities(drupal_get_title());
-    $html = theme('sharethis', array('data_options' => $data_options, 'm_path' => $mPath, 'm_title' => $mTitle));
+    $html = theme('sharethis', array(
+      'data_options' => $data_options,
+      'm_path' => $mPath,
+      'm_title' => $mTitle));
     $comment->content['sharethis'] = array(
       '#type' => 'html_tag',
       '#value' => $html,
@@ -528,7 +555,10 @@ function sharethis_comment_view($comment, $view_mode, $langcode) {
  */
 function sharethis_contextual_links_view_alter(&$element, $items) {
   // Add the configuration link for the ShareThis settings on the block itself.
-  if (isset($element['#element']['#block']->module) && $element['#element']['#block']->module == 'sharethis' && $element['#element']['#block']->delta == 'sharethis_block' && user_access('access administration pages')) {
+  if (isset($element['#element']['#block']->module) &&
+    $element['#element']['#block']->module == 'sharethis' &&
+    $element['#element']['#block']->delta == 'sharethis_block' && 
+    user_access('access administration pages')) {
     $element['#links']['sharethis-configure'] = array(
       'title' => t('Configure ShareThis'),
       'href' => 'admin/config/services/sharethis',
@@ -547,10 +577,11 @@ function sharethis_views_api() {
 }
 
 /**
- * Implements of hook_ctools_plugin_directory
+ * Implements of hook_ctools_plugin_directory.
  */
 function sharethis_ctools_plugin_directory($module, $plugin) {
   if ($module == 'panels' || $module == 'ctools') {
     return 'plugins/' . $plugin;
   }
 }
+
diff --git a/stlib_picker.js b/stlib_picker.js
index f3f85e2..eb4855b 100644
--- a/stlib_picker.js
+++ b/stlib_picker.js
@@ -7,8 +7,8 @@
 // stlib_picker.defaultServices defines the services from stcommon that get loaded as the default services in the picker
 // Styling can be found in stlib_picker.css and should be linked in the page.
 // To get selected services as an array of strings:  (ie ["twitter", "sharethis", "facebook"] )
-//  Call: var answer = stlib_picker.pickerList[uniqueID]["getServices"]();.
-var stlib_picker = {}, isSecure = ("https:" == document.location.protocol) ? true : false;
+// Call: var answer = stlib_picker.pickerList[uniqueID]["getServices"]();.
+var stlib_picker = {}, isSecure = ('https:' == document.location.protocol) ? true : false;
 stlib_picker.pickerList = [];
 stlib_picker.defaultServices = ["sharethis", "tumblr", "bebo"];
 stlib_picker.getServices = function (id) {
@@ -18,7 +18,7 @@ stlib_picker.getServices = function (id) {
 
 // Creates the picker - make sure it has a unique ID.
 stlib_picker.setupPicker = function (jQElement, newDefaults, callback) {
-  console.log("setting up picker");
+  console.log('setting up picker');
   console.log(jQElement);
   // Make an array to store any needed options.
   var optionsArray = [];
@@ -26,22 +26,23 @@ stlib_picker.setupPicker = function (jQElement, newDefaults, callback) {
   optionsArray["isSelect"] = false;
   optionsArray["getServices"] = function () {
     var answer = [];
-    var lis = jQElement.children(".stp_pickerLeft").find(".stp_li");
+    var lis = jQElement.children('.stp_pickerLeft').find('.stp_li');
     lis.each(function () {
-      answer.push(jQuery(this).attr("id").substring(6));
+      answer.push(jQuery(this).attr('id').substring(6));
     });
     return answer;
   };
 
   // Append the three divs that are needed:
-  jQElement.append("<div class='stp_pickerLeft'><span class='stp_header'>Selected Service</span><ul class='stp_ulLeft'></ul></div>");
-  jQElement.append("<div class='stp_pickerArrow'><div class='stp_arrow'><img class='stp_up' src='//www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-                                                  "<div class='stp_arrow'><img class='stp_left' src='//www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-                                                  "<div class='stp_arrow'><img class='stp_right' src='//www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-                                                  "<div class='stp_arrow'><img class='stp_down' src='//www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+  jQElement.append('<div class="stp_pickerLeft"><span class="stp_header">Selected Service</span><ul class="stp_ulLeft"></ul></div>');
+  jQElement.append('<div class="stp_pickerArrow">' +
+                    '<div class="stp_arrow"><img class="stp_up" src="//www.sharethis.com/images/Direction_Icons_Sprite.png"></img></div>' +
+                    "<div class='stp_arrow'><img class='stp_left' src='//www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+                    "<div class='stp_arrow'><img class='stp_right' src='//www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+                    "<div class='stp_arrow'><img class='stp_down' src='//www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
                     "</div>");
-  jQElement.append("<div class='stp_pickerRight'><span class='stp_header'>Possible Services</span><ul class='stp_ulRight'></ul></div>");
-  jQElement.append("<div class='stp_clear'></div>");
+  jQElement.append('<div class="stp_pickerRight"><span class="stp_header">Possible Services</span><ul class="stp_ulRight"></ul></div>');
+  jQElement.append('<div class="stp_clear"></div>');
 
   // Add default Services.
   var pickerDefaults = [];
@@ -55,38 +56,38 @@ stlib_picker.setupPicker = function (jQElement, newDefaults, callback) {
   // Add all the services to the picker:
   jQuery.each(_all_services, function (key, value) {
     if (jQuery.inArray(key, pickerDefaults) == -1) {
-      var ul = jQElement.children(".stp_pickerRight").children(".stp_ulRight");
+      var ul = jQElement.children('.stp_pickerRight').children('.stp_ulRight');
       if (isSecure) {
-        ul.append("<li id='st_li_" + key + "' class='stp_li'><img src='https://ws.sharethis.com/images/" + key + "_32.png'></img><span class='stp_liText'>" + value.title + "</span></li>");
+        ul.append('<li id="st_li_"' + key +  'class="stp_li"><img src="https://ws.sharethis.com/images/"' + key + '_32.png></img><span class="stp_liText">' + value.title + '</span></li>');
       }
       else {
-        ul.append("<li id='st_li_" + key + "' class='stp_li'><img src='http://w.sharethis.com/images/" + key + "_32.png'></img><span class='stp_liText'>" + value.title + "</span></li>");
+        ul.append('<li id="st_li_"' + key + ' class="stp_li"><img src="http://w.sharethis.com/images/"' + key + '_32.png></img><span class="stp_liText">' + value.title + '</span></li>');
       }
 
     }
   });
   for (i = 0; i < pickerDefaults.length; i++) {
-    var ul = jQElement.children(".stp_pickerLeft").children(".stp_ulLeft");
+    var ul = jQElement.children('.stp_pickerLeft').children('.stp_ulLeft');
     if (isSecure) {
-      ul.append("<li id='st_li_" + pickerDefaults[i] + "' class='stp_li'><img src='https://ws.sharethis.com/images/" + pickerDefaults[i] + "_32.png'></img><span class='stp_liText'>" + _all_services[pickerDefaults[i]].title + "</span></li>");
+      ul.append('<li id="st_li_"' + pickerDefaults[i] + ' class="stp_li"><img src="https://ws.sharethis.com/images/"' + pickerDefaults[i] + '_32.png></img><span class="stp_liText">' + _all_services[pickerDefaults[i]].title + '</span></li>');
     }
     else {
-      ul.append("<li id='st_li_" + pickerDefaults[i] + "' class='stp_li'><img src='http://w.sharethis.com/images/" + pickerDefaults[i] + "_32.png'></img><span class='stp_liText'>" + _all_services[pickerDefaults[i]].title + "</span></li>");
+      ul.append('<li id="st_li_"' + pickerDefaults[i] + ' class="stp_li"><img src="http://w.sharethis.com/images/"' + pickerDefaults[i] + '_32.png></img><span class="stp_liText">' + _all_services[pickerDefaults[i]].title + '</span></li>');
     }
   }
 
   // Add the various Event handlers
   // Need to make sure that we don't get confused when there are multiple pickers.
-  jQElement.find(".stp_li").click(function () {
-    jQElement.find(".stp_select").removeClass("stp_select");
-    jQuery(this).addClass("stp_select");
-    stlib_picker.pickerList[jQElement.attr("id")]["isSelect"] = true;
+  jQElement.find('.stp_li').click(function () {
+    jQElement.find('.stp_select').removeClass('stp_select');
+    jQuery(this).addClass('stp_select');
+    stlib_picker.pickerList[jQElement.attr('id')]["isSelect"] = true;
   });
 
-  var arrowDiv = jQElement.children(".stp_pickerArrow").children(".stp_arrow");
-  arrowDiv.children(".stp_up").click(function () {
-    if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
-      var li = jQElement.find(".stp_select");
+  var arrowDiv = jQElement.children('.stp_pickerArrow').children('.stp_arrow');
+  arrowDiv.children('.stp_up').click(function () {
+    if (stlib_picker.pickerList[jQElement.attr('id')]["isSelect"]) {
+      var li = jQElement.find('.stp_select');
       var prev = li.prev();
       if (prev.length != 0) {
         prev.before(li);
@@ -96,31 +97,31 @@ stlib_picker.setupPicker = function (jQElement, newDefaults, callback) {
       }
     }
   });
-  arrowDiv.children(".stp_left").click(function () {
-    if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
-      var li = jQElement.find(".stp_select");
-      var ul = jQElement.children(".stp_pickerLeft").children(".stp_ulLeft");
+  arrowDiv.children('.stp_left').click(function () {
+    if (stlib_picker.pickerList[jQElement.attr('id')]["isSelect"]) {
+      var li = jQElement.find('.stp_select');
+      var ul = jQElement.children('.stp_pickerLeft').children('.stp_ulLeft');
       ul.prepend(li);
       if (callback) {
         callback();
       }
     }
   });
-  arrowDiv.children(".stp_right").click(function () {
-    if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
-      var li = jQElement.find(".stp_select");
-      var ul = jQElement.children(".stp_pickerRight").children(".stp_ulRight");
+  arrowDiv.children('.stp_right').click(function () {
+    if (stlib_picker.pickerList[jQElement.attr('id')]["isSelect"]) {
+      var li = jQElement.find('.stp_select');
+      var ul = jQElement.children('.stp_pickerRight').children('.stp_ulRight');
       ul.prepend(li);
       if (callback) {
         callback();
       }
     }
   });
-  arrowDiv.children(".stp_down").click(function () {
-    if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
-      var li = jQElement.find(".stp_select");
+  arrowDiv.children('.stp_down').click(function () {
+    if (stlib_picker.pickerList[jQElement.attr('id')]["isSelect"]) {
+      var li = jQElement.find('.stp_select');
       var next = li.next();
-      if (next.length != 0) {
+      if (next.length !== 0) {
         next.after(li);
       }
       if (callback) {
@@ -130,5 +131,5 @@ stlib_picker.setupPicker = function (jQElement, newDefaults, callback) {
   });
 
   // Save the options (and the picker) globally.
-  stlib_picker.pickerList[jQElement.attr("id")] = optionsArray;
+  stlib_picker.pickerList[jQElement.attr('id')] = optionsArray;
 }
diff --git a/views/sharethis.views.inc b/views/sharethis.views.inc
index 4e55546..2b013f5 100644
--- a/views/sharethis.views.inc
+++ b/views/sharethis.views.inc
@@ -29,7 +29,6 @@ function sharethis_views_data() {
  */
 function sharethis_views_data_alter(&$data) {
   if (module_exists('search_api_views')) {
-    $entity_types = entity_get_info();
     foreach (search_api_index_load_multiple(FALSE) as $index) {
       $key = 'search_api_index_' . $index->machine_name;
       if (isset($data[$key])) {
@@ -45,3 +44,4 @@ function sharethis_views_data_alter(&$data) {
     }
   }
 }
+
diff --git a/views/sharethis_handler_field_link.inc b/views/sharethis_handler_field_link.inc
index b03819f..108f024 100644
--- a/views/sharethis_handler_field_link.inc
+++ b/views/sharethis_handler_field_link.inc
@@ -27,8 +27,8 @@ class SharethisHandlerFieldLink extends views_handler_field_entity {
       'data_options' => sharethis_get_options_array(),
       'm_title' => $entity->title,
       'm_path' => $path,
-    ));
-
+      ));
   }
 
 }
+
