diff --git a/ShareThisForm.js b/ShareThisForm.js
index 583827f..5918f41 100644
--- a/ShareThisForm.js
+++ b/ShareThisForm.js
@@ -4,158 +4,161 @@
  */
 
 // Create the drupal ShareThis object for clean code and namespacing:
-var drupal_st = {
-  // These are handlerd for updating the widget pic class.
-  multiW: function () {
-    jQuery(".st_widgetPic").addClass("st_multi");
-  },
-  classicW: function () {
-    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_");
-  },
-  largeChicklet: function () {
-    drupal_st.removeButtonClasses();
-    jQuery("#stb_sprite").addClass("stbc_large");
-  },
-  hcount: function () {
-    drupal_st.removeButtonClasses();
-    jQuery("#stb_sprite").addClass("stbc_hcount");
-  },
-  vcount: function () {
-    drupal_st.removeButtonClasses();
-    jQuery("#stb_sprite").addClass("stbc_vcount");
-  },
-  button: function () {
-    drupal_st.removeButtonClasses();
-    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");
-  },
-  // Write helper functions for saving:
-  getWidget: function () {
-    return jQuery(".st_widgetPic").hasClass("st_multiW") ? '5x' : '4x';
-  },
-  getButtons: function () {
-    var selectedButton = 'large';
-    var buttonButtons = jQuery(".st_wIm");
-    buttonButtons.each(function () {
-      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"});
-
-    if (jQuery('input[name=sharethis_callesi]').val() == 1) {
-      // alert("esi called");.
-      drupal_st.getGlobalCNSConfig();
-    }
-    else {
-      // alert("settings found");.
-    }
-  },
-  odjs: function (scriptSrc,callBack) {
-    this.head = document.getElementsByTagName('head')[0];
-    this.scriptSrc = scriptSrc;
-    this.script = document.createElement('script');
-    this.script.setAttribute('type', 'text/javascript');
-    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")) {
-        callBack();
-      }
-    };
-    this.head.appendChild(this.script);
-  },
-  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"));
-    }
-    catch (err) {
-      drupal_st.cnsCallback(err);
-    }
-  },
-  updateDoNotHash: function () {
-    jQuery('input[name=sharethis_callesi]').val(0);
-  },
-  // 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);
+(function () {
+  // Adding use strict as function encapsulation ECMA 6.
+  'use strict';
 
-    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);
+  var drupal_st = {
+    // These are handlerd for updating the widget pic class.
+    multiW: function () {
+      jQuery('.st_widgetPic').addClass('st_multi');
+    },
+    classicW: function () {
+      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_');
+    },
+    largeChicklet: function () {
+      drupal_st.removeButtonClasses();
+      jQuery('#stb_sprite').addClass('stbc_large');
+    },
+    hcount: function () {
+      drupal_st.removeButtonClasses();
+      jQuery('#stb_sprite').addClass('stbc_hcount');
+    },
+    vcount: function () {
+      drupal_st.removeButtonClasses();
+      jQuery('#stb_sprite').addClass('stbc_vcount');
+    },
+    button: function () {
+      drupal_st.removeButtonClasses();
+      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');
+    },
+    // Write helper functions for saving:
+    getWidget: function () {
+      return jQuery('.st_widgetPic').hasClass('st_multiW') ? '5x' : '4x';
+    },
+    getButtons: function () {
+      var selectedButton = 'large';
+      var buttonButtons = jQuery('.st_wIm');
+      buttonButtons.each(function () {
+        if (jQuery(this).hasClass('st_select')) {
+          selectedButton = jQuery(this).attr('id').substring(3);
+        }
+      });
+      return selectedButton;
+    },
+    setupServiceText: function () {
+      jQuery('#edit-sharethis-service-option').css({display: 'none'});
 
-    jQuery(".st_formButtonSave").click(drupal_st.updateOptions);
+      if (jQuery('input[name=sharethis_callesi]').val() === 1) {
+        drupal_st.getGlobalCNSConfig();
+      }
+      else {
+        // alert('settings found');.
+      }
+    },
+    odjs: function (scriptSrc, callBack) {
+      this.head = document.getElementsByTagName('head')[0];
+      this.scriptSrc = scriptSrc;
+      this.script = document.createElement('script');
+      this.script.setAttribute('type', 'text/javascript');
+      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')) {
+          callBack();
+        }
+      };
+      this.head.appendChild(this.script);
+    },
+    getGlobalCNSConfig: function () {
+      try {
+        drupal_st.odjs(document.location.protocol === 'https:' ? '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);
+      }
+    },
+    updateDoNotHash: function () {
+      jQuery('input[name=sharethis_callesi]').val(0);
+    },
+    // 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('#st_cns_settings').find('input').live('click', drupal_st.updateDoNotHash);
-  },
-  serviceCallback: function () {
-    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);
-  },
-  to_boolean: function (str) {
-    return str === true || jQuery.trim(str).toLowerCase() === 'true';
-  },
-  cnsCallback: function (response) {
-    if ((response instanceof Error) || (response == "" || (typeof(response) == "undefined"))) {
-      // Setting default config.
-      response = '{"doNotHash": true, "doNotCopy": true, "hashAddressBar": false}';
-      response = jQuery.parseJSON(response);
-    }
+      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);
 
-    var obj = {
-      doNotHash: drupal_st.to_boolean(response.doNotHash),
-      doNotCopy: drupal_st.to_boolean(response.doNotCopy),
-      hashAddressBar: drupal_st.to_boolean(response.hashAddressBar)
-    };
+      jQuery('.st_formButtonSave').click(drupal_st.updateOptions);
 
-    if (obj.doNotHash == false || obj.doNotHash === "false") {
-      if (obj.doNotCopy === true || obj.doNotCopy == "true") {
-        jQuery(jQuery('#st_cns_settings').find('input')[0]).removeAttr("checked");
+      jQuery('#st_cns_settings').find('input').live('click', drupal_st.updateDoNotHash);
+    },
+    serviceCallback: function () {
+      var services = stlib_picker.getServices('myPicker');
+      var outputString = '';
+      for (i = 0; i < services.length; i++) {
+        outputString += '\"' + _all_services[services[i]].title + ':';
+        outputString += services[i] + '\",';
       }
-      else {
-        jQuery(jQuery('#st_cns_settings').find('input')[0]).attr("checked",true);
+      outputString = outputString.substring(0, outputString.length - 1);
+      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'))) {
+        // Setting default config.
+        response = '{"doNotHash": true, "doNotCopy": true, "hashAddressBar": false}';
+        response = jQuery.parseJSON(response);
       }
-      if (obj.hashAddressBar === true || obj.hashAddressBar == "true") {
-        jQuery(jQuery('#st_cns_settings').find('input')[1]).attr("checked",true);
+
+      var obj = {
+        doNotHash: drupal_st.to_boolean(response.doNotHash),
+        doNotCopy: drupal_st.to_boolean(response.doNotCopy),
+        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');
+        }
+        else {
+          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);
+        }
+        else {
+          jQuery(jQuery('#st_cns_settings').find('input')[1]).removeAttr('checked');
+        }
       }
       else {
-        jQuery(jQuery('#st_cns_settings').find('input')[1]).removeAttr("checked");
+        jQuery('#st_cns_settings').find('input').each(function (index) {
+          jQuery(this).removeAttr('checked');
+        });
       }
     }
-    else {
-      jQuery('#st_cns_settings').find('input').each(function (index) {
-        jQuery(this).removeAttr("checked");
-      });
-    }
-  }
-};
-// After the page is loaded, we want to add events to dynamically created elements.
-jQuery(document).ready(drupal_st.addEvents);
-// After it's all done, hide the text field for the service picker so that no one messes up the data.
-jQuery(document).ready(drupal_st.setupServiceText);
+  };
+  // After the page is loaded, we want to add events to dynamically created elements.
+  jQuery(document).ready(drupal_st.addEvents);
+  // After it's all done, hide the text field for the service picker so that no one messes up the data.
+  jQuery(document).ready(drupal_st.setupServiceText);
+})();
diff --git a/plugins/content_types/sharethis/sharethis.inc b/plugins/content_types/sharethis/sharethis.inc
index 318faf9..c33c118 100644
--- a/plugins/content_types/sharethis/sharethis.inc
+++ b/plugins/content_types/sharethis/sharethis.inc
@@ -18,6 +18,9 @@ $plugin = array(
   ),
 );
 
+/**
+ * Sharethis content type render function.
+ */
 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;
 }
 
+/**
+ * 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.');
@@ -76,12 +82,18 @@ function sharethis_sharethis_content_type_edit_form($form, &$form_state) {
   return $form;
 }
 
+/**
+ * Validates the sharethis content type edit form.
+ */
 function sharethis_sharethis_content_type_edit_form_validate($form, &$form_state) {
   if (($form_state['values']['path'] == 'external') && (!valid_url($form_state['values']['path-external'], TRUE))) {
     form_set_error('path-external', t('Invalid URL'));
   }
 }
 
+/**
+ * Sharethis content type edit form submit handler.
+ */
 function sharethis_sharethis_content_type_edit_form_submit($form, &$form_state) {
   foreach (array('path', 'path-external') as $key) {
     $form_state['conf'][$key] = $form_state['values'][$key];
diff --git a/sharethis.admin.inc b/sharethis.admin.inc
index 189f755..dccfbc6 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.
@@ -21,7 +22,6 @@ function sharethis_configuration_form($form, &$form_state) {
   drupal_add_css($my_path . '/stlib_picker.css');
   $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 = "";
@@ -34,7 +34,7 @@ function sharethis_configuration_form($form, &$form_state) {
   $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 . "\",";
@@ -75,7 +75,7 @@ function sharethis_configuration_form($form, &$form_state) {
     '#prefix' => '<div>',
     '#suffix' => '</div><div id="myPicker"></div><script type="text/javascript">stlib_picker.setupPicker(jQuery("#myPicker"), [' . $service_string_markup . '], drupal_st.serviceCallback);</script>',
     '#title' => t("Choose Your Services."),
-    '#default_value' => t($service_string),
+    '#default_value' => t("@service_string", array('@service_string' => $service_string)),
     '#maxlength' => 1024,
   );
   $form['options']['sharethis_option_extras'] = array(
@@ -230,7 +230,7 @@ function sharethis_configuration_form($form, &$form_state) {
   $content_types = array();
   $enabled_content_types = $current_options_array['sharethis_node_types'];
   foreach ($entity_info['bundles'] as $bundle => $bundle_info) {
-    $content_types[$bundle] = t($bundle_info['label']);
+    $content_types[$bundle] = t("@label", array('@label' => $bundle_info['label']));
   }
   $form['context']['content']['sharethis_node_types'] = array(
     '#title' => t('Node Types'),
@@ -251,8 +251,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 +334,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"),
diff --git a/sharethis.install b/sharethis.install
index 07dc6ae..7f90a74 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']) {
diff --git a/sharethis.module b/sharethis.module
index a83d31e..47094b4 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.
@@ -8,18 +9,12 @@
  * Implements hook_help().
  *
  * Displays help and module information.
- *
- * @param path
- *   Which path of the site we're using to display help
- * @param arg
- *   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 +23,18 @@ 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 +62,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 +72,7 @@ function sharethis_configuration_form_submit($form, &$form_state) {
   }
 }
 
- /**
+/**
  * Implements hook_menu().
  *
  * This is the ShareThis Config Menu.
@@ -98,18 +89,11 @@ function sharethis_menu() {
   return $items;
 }
 
- /**
+/**
  * Implements hook_node_view().
  *
  * Inserts ShareThis widget code onto each node view.
- * TODO: Want to add the option somewhere to select nodes.
- *
- * @param node
- *   The node that is being acted upon
- * @param view_mode
- *   The type of view (teaser, full, etc)
- * @param langcode
- *   Information about the language
+ * @TODO: Want to add the option somewhere to select nodes.
  */
 function sharethis_node_view($node, $view_mode, $langcode) {
   // Don't display if the user is currently searching, or in the RSS feed.
@@ -134,12 +118,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 +136,18 @@ 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 +158,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 +187,8 @@ function sharethis_field_extra_fields() {
           'weight' => intval(variable_get('sharethis_weight', 10)),
         ),
       );
-     }
-   }
+    }
+  }
   return $extra;
 }
 
@@ -213,31 +208,32 @@ 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";
+ * Function sharethis_get_light_options() is creating options.
+ * It has to be passed to stLight.options
+ * $data_options array is 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 +241,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 +249,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 +265,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 +275,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,17 +315,18 @@ 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']);
   $st_spans = "";
   foreach ($service_array as $service_full) {
-    // Strip the quotes from the element in the array (They are there for javascript)
+    // Strip the quotes from the element in the array for javascript.
     $service = explode(":", $service_full);
 
-    // Service names are expected to be parsed by Name:machine_name. If only one
-    // element in the array is given, it's an invalid service.
+    // Service names are expected to be parsed by Name:machine_name.
+    // If only one element in the array is given, it's an invalid service.
     if (count($service) < 2) {
       continue;
     }
@@ -342,9 +339,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 +367,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.
@@ -400,7 +403,6 @@ function theme_sharethis($variables) {
     ));
   }
 
-
   // Output the embedded JavaScript.
   // sharethis_include_js();
   return '<div class="sharethis-wrapper">' . $st_spans . '</div>';
@@ -428,15 +430,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']) && drupal_strtolower($_SERVER['HTTPS']) == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && drupal_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 +447,7 @@ function sharethis_include_js() {
   }
   return $has_run;
 }
+
 /**
  * Implements hook_block_info().
  */
@@ -456,9 +460,9 @@ function sharethis_block_info() {
 }
 
 /**
- * Implements of hook_block_view().
+ * Implements hook_block_view().
  */
-function sharethis_block_view($delta='') {
+function sharethis_block_view($delta = '') {
   $block = array();
   switch ($delta) {
     case 'sharethis_block':
@@ -469,8 +473,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') {
@@ -484,7 +490,7 @@ function sharethis_block_contents() {
       return $cache->data;
     }
     else {
-      // First get all of the options for the sharethis widget from the database:
+      // Get all of the options for the sharethis widget from the database.
       $data_options = sharethis_get_options_array();
       $path = isset($_GET['q']) ? $_GET['q'] : '<front>';
       if ($path == variable_get('site_frontpage')) {
@@ -492,7 +498,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 +516,16 @@ 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,
     ));
     $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 +541,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,7 +563,7 @@ function sharethis_views_api() {
 }
 
 /**
- * Implements of hook_ctools_plugin_directory
+ * Implements hook_ctools_plugin_directory().
  */
 function sharethis_ctools_plugin_directory($module, $plugin) {
   if ($module == 'panels' || $module == 'ctools') {
diff --git a/stlib_picker.js b/stlib_picker.js
index f3f85e2..4b1cfdd 100644
--- a/stlib_picker.js
+++ b/stlib_picker.js
@@ -7,128 +7,134 @@
 // 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;
-stlib_picker.pickerList = [];
-stlib_picker.defaultServices = ["sharethis", "tumblr", "bebo"];
-stlib_picker.getServices = function (id) {
-  var func = stlib_picker.pickerList[id]["getServices"];
-  return func();
-}
+// Call: var answer = stlib_picker.pickerList[uniqueID]["getServices"]();.
+(function () {
+  // Adding use strict as function encapsulation ECMA 6.
+  'use strict';
 
-// Creates the picker - make sure it has a unique ID.
-stlib_picker.setupPicker = function (jQElement, newDefaults, callback) {
-  console.log("setting up picker");
-  console.log(jQElement);
-  // Make an array to store any needed options.
-  var optionsArray = [];
-  optionsArray["El"] = jQElement;
-  optionsArray["isSelect"] = false;
-  optionsArray["getServices"] = function () {
-    var answer = [];
-    var lis = jQElement.children(".stp_pickerLeft").find(".stp_li");
-    lis.each(function () {
-      answer.push(jQuery(this).attr("id").substring(6));
-    });
-    return answer;
-  };
+  var stlib_picker = {};
+  var isSecure = document.location.protocol === 'https:' ? true : false;
 
-  // 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>" +
-                    "</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>");
+  stlib_picker.pickerList = [];
+  stlib_picker.defaultServices = ['sharethis', 'tumblr', 'bebo'];
+  stlib_picker.getServices = function (id) {
+    var func = stlib_picker.pickerList[id]['getServices'];
+    return func();
+  };
 
-  // Add default Services.
-  var pickerDefaults = [];
-  if (newDefaults) {
-    pickerDefaults = newDefaults;
-  }
-  else {
-    pickerDefaults = stlib_picker.defaultServices;
-  }
+  // Creates the picker - make sure it has a unique ID.
+  stlib_picker.setupPicker = function (jQElement, newDefaults, callback) {
+    // Make an array to store any needed options.
+    var optionsArray = [];
+    optionsArray['El'] = jQElement;
+    optionsArray['isSelect'] = false;
+    optionsArray['getServices'] = function () {
+      var answer = [];
+      var lis = jQElement.children('.stp_pickerLeft').find('.stp_li');
+      lis.each(function () {
+        answer.push(jQuery(this).attr('id').substring(6));
+      });
+      return answer;
+    };
 
-  // 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");
-      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>");
-      }
-      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>");
-      }
+    // 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>' +
+                      '</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>');
 
-    }
-  });
-  for (i = 0; i < pickerDefaults.length; i++) {
-    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>");
+    // Add default Services.
+    var pickerDefaults = [];
+    if (newDefaults) {
+      pickerDefaults = newDefaults;
     }
     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>");
+      pickerDefaults = stlib_picker.defaultServices;
     }
-  }
 
-  // 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;
-  });
+    // 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');
+        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>');
+        }
+        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>');
+        }
 
-  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);
       }
-      if (callback) {
-        callback();
+    });
+    for (i = 0; i < pickerDefaults.length; i++) {
+      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>');
       }
-    }
-  });
-  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();
+      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>');
       }
     }
-  });
-  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();
+
+    // 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;
+    });
+
+    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);
+        }
+        if (callback) {
+          callback();
+        }
       }
-    }
-  });
-  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) {
-        next.after(li);
+    });
+    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();
+        }
       }
-      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');
+        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');
+        var next = li.next();
+        if (next.length !== 0) {
+          next.after(li);
+        }
+        if (callback) {
+          callback();
+        }
+      }
+    });
 
-  // Save the options (and the picker) globally.
-  stlib_picker.pickerList[jQElement.attr("id")] = optionsArray;
-}
+    // Save the options (and the picker) globally.
+    stlib_picker.pickerList[jQElement.attr('id')] = optionsArray;
+  };
+})();
diff --git a/views/sharethis.views.inc b/views/sharethis.views.inc
index 4e55546..ada1642 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])) {
diff --git a/views/sharethis_handler_field_link.inc b/views/sharethis_handler_field_link.inc
index b03819f..bee1504 100644
--- a/views/sharethis_handler_field_link.inc
+++ b/views/sharethis_handler_field_link.inc
@@ -10,12 +10,18 @@
  */
 class SharethisHandlerFieldLink extends views_handler_field_entity {
 
+  /**
+   * Render values.
+   */
   public function render($values) {
     if ($entity = $this->get_value($values)) {
       return $this->renderSharethisLink($entity);
     }
   }
 
+  /**
+   * Renders sharethis link.
+   */
   public function renderSharethisLink($entity) {
     $path = url('node/' . $entity->nid, array('absolute' => TRUE));
 
@@ -28,7 +34,6 @@ class SharethisHandlerFieldLink extends views_handler_field_entity {
       'm_title' => $entity->title,
       'm_path' => $path,
     ));
-
   }
 
 }
