diff --git jquery_update.module jquery_update.module
index 10310e2..bc4cb28 100644
--- jquery_update.module
+++ jquery_update.module
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Updates Drupal to use the latest version of jQuery.
+ * Updates Drupal to use the latest versions of jQuery and jQuery UI.
  */
 
 /**
@@ -48,10 +48,9 @@ function jquery_update_library() {
 }
 
 /**
- * Implementation of hook_js_alter().
+ * Implements hook_library_alter().
  */
-function jquery_update_library_alter(&$javascript, $module) {
-
+function jquery_update_library_alter(&$libraries, $module) {
   // We are updating just the system module. For all other cases we return.
   if ($module != 'system') {
     return;
@@ -64,26 +63,26 @@ function jquery_update_library_alter(&$javascript, $module) {
   $cdn = variable_get('jquery_update_jquery_cdn', 'none');
 
   // Replace jQuery.
-  jquery_update_jquery_replace($javascript, $cdn, $path, $min); 
-  $javascript['jquery']['version'] = '1.5.1';
+  jquery_update_jquery_replace($libraries, $cdn, $path, $min);
+  $libraries['jquery']['version'] = '1.5.1';
 
   // Replace jQuery UI with CDN or local files. If from a CDN include all of jQuery UI.
-  jquery_update_jqueryui_replace($javascript, $cdn, $path, $min);
+  jquery_update_jqueryui_replace($libraries, $cdn, $path, $min);
 
   // Replace the jQuery Cookie plugin.
-  $javascript['cookie']['js']['misc/jquery.cookie.js']['data'] = $path . '/replace/ui/external/jquery.cookie.js';
+  $libraries['jquery.cookie']['js']['misc/jquery.cookie.js']['data'] = $path . '/replace/ui/external/jquery.cookie.js';
   // Noting the version based on git commit as no version number is available.
-  $javascript['cookie']['version'] = '67fb34f6a866c40d0570';
+  $libraries['jquery.cookie']['version'] = '67fb34f6a866c40d0570';
 
   // Replace jQuery Form plugin.
-  $javascript['jquery.form']['js']['misc/jquery.form.js']['data'] = $path . '/replace/misc/jquery.form.js';
-  $javascript['jquery.form']['version'] = '2.67';
+  $libraries['jquery.form']['js']['misc/jquery.form.js']['data'] = $path . '/replace/misc/jquery.form.js';
+  $libraries['jquery.form']['version'] = '2.67';
 }
 
 /**
- * Implementation of hook_form_FORM_ID_alter().
+ * Implements hook_form_FORM_ID_alter().
  */
-function jquery_update_form_system_performance_settings_alter(&$form, &$form_state) {
+function jquery_update_form_system_performance_settings_alter(&$form, &$form_state, $form_id) {
   $form['bandwidth_optimization']['jquery_update_compression_type'] = array(
     '#type' => 'radios',
     '#title' => t('jQuery compression level'),
@@ -109,7 +108,7 @@ function jquery_update_form_system_performance_settings_alter(&$form, &$form_sta
 /**
  * Update jQuery to the CDN or local path.
  *
- * @param array $javascript
+ * @param array $libraries
  *   The library definition array as seen in hook_library_alter().
  * @param string $cdn
  *   The name of the CDN option to use. Possible options are:
@@ -117,20 +116,20 @@ function jquery_update_form_system_performance_settings_alter(&$form, &$form_sta
  *   - google
  *   - microsoft
  */
-function jquery_update_jquery_replace(&$javascript, $cdn, $path, $min) {
+function jquery_update_jquery_replace(&$libraries, $cdn, $path, $min) {
   switch($cdn) {
     case 'google':
-      $javascript['jquery']['js']['misc/jquery.js']['data'] = 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery' . $min . '.js';
-      $javascript['jquery']['js']['misc/jquery.js']['type'] = 'external';
-      jquery_update_jquery_backup($javascript, $path, $min);
+      $libraries['jquery']['js']['misc/jquery.js']['data'] = 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery' . $min . '.js';
+      $libraries['jquery']['js']['misc/jquery.js']['type'] = 'external';
+      jquery_update_jquery_backup($libraries, $path, $min);
       break;
     case 'microsoft':
-      $javascript['jquery']['js']['misc/jquery.js']['data'] = 'http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1' . $min . '.js';
-      $javascript['jquery']['js']['misc/jquery.js']['type'] = 'external';
-      jquery_update_jquery_backup($javascript, $path, $min);
+      $libraries['jquery']['js']['misc/jquery.js']['data'] = 'http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1' . $min . '.js';
+      $libraries['jquery']['js']['misc/jquery.js']['type'] = 'external';
+      jquery_update_jquery_backup($libraries, $path, $min);
       break;
     case 'none':
-      $javascript['jquery']['js']['misc/jquery.js']['data'] = $path . '/replace/jquery/jquery' . $min . '.js';
+      $libraries['jquery']['js']['misc/jquery.js']['data'] = $path . '/replace/jquery/jquery' . $min . '.js';
       break;
   }
 }
@@ -138,15 +137,15 @@ function jquery_update_jquery_replace(&$javascript, $cdn, $path, $min) {
 /**
  * Add the local fallback in case jQuery from the CDN is unavailable.
  *
- * @param array $javascript
+ * @param array $libraries
  *   The $libraries array as seen in hook_library_alter()
  * @param string $path
  *   The path to the module where replacements can be found.
  * @param string $min
  *   The '.min' to include in the file name if we are requesting a minified version.
  */
-function jquery_update_jquery_backup(&$javascript, $path, $min) {
-  $javascript['jquery']['js'][] = array(
+function jquery_update_jquery_backup(&$libraries, $path, $min) {
+  $libraries['jquery']['js'][] = array(
     'data' => 'window.jQuery || document.write("<script src=\'' . base_path() . $path . '/replace/jquery/jquery' . $min . '.js\'>\x3C/script>")',
     'type' => 'inline',
     'group' => JS_LIBRARY,
@@ -157,7 +156,7 @@ function jquery_update_jquery_backup(&$javascript, $path, $min) {
 /**
  * Update jQuery UI to the CDN or local path.
  *
- * @param array $javascript
+ * @param array $libraries
  *   The library definition array as seen in hook_library_alter().
  * @param string $cdn
  *   The name of the CDN option to use. Possible options are:
@@ -165,7 +164,7 @@ function jquery_update_jquery_backup(&$javascript, $path, $min) {
  *   - google
  *   - microsoft
  */
-function jquery_update_jqueryui_replace(&$javascript, $cdn, $path, $min) {
+function jquery_update_jqueryui_replace(&$libraries, $cdn, $path, $min) {
   // Replace all CSS files.
   $names = drupal_map_assoc(array(
     'ui.accordion', 'ui.autocomplete', 'ui.button', 'ui.datepicker',
@@ -175,10 +174,10 @@ function jquery_update_jqueryui_replace(&$javascript, $cdn, $path, $min) {
   $names['ui'] = 'ui.core';
   $csspath = $path . '/replace/ui/themes/base/' . (($min == '.min') ? 'minified/' : '');
   foreach ($names as $name => $file) {
-    $javascript[$name]['css']["misc/ui/jquery.$file.css"]['data'] = $csspath . 'jquery.' . $file . $min . '.css';
+    $libraries[$name]['css']["misc/ui/jquery.$file.css"]['data'] = $csspath . 'jquery.' . $file . $min . '.css';
   }
   // Make sure ui.theme is replaced as well.
-  $javascript['ui']['css']['misc/ui/jquery.ui.theme.css']['data'] = $csspath . 'jquery.ui.theme' . $min . '.css';
+  $libraries['ui']['css']['misc/ui/jquery.ui.theme.css']['data'] = $csspath . 'jquery.ui.theme' . $min . '.css';
 
   // Replace jQuery UI's JavaScript, beginning by defining the mapping.
   $names = drupal_map_assoc(array(
@@ -196,16 +195,16 @@ function jquery_update_jqueryui_replace(&$javascript, $cdn, $path, $min) {
   switch($cdn) {
     case 'google':
       $cdn = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui' . $min . '.js';
-      jquery_update_jqueryui_cdn($cdn, &$javascript, $path, $min, $names);
-      jquery_update_jqueryui_backup($javascript, $path, $min);
+      jquery_update_jqueryui_cdn($cdn, &$libraries, $path, $min, $names);
+      jquery_update_jqueryui_backup($libraries, $path, $min);
       break;
     case 'microsoft':
       $cdn = 'http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.11/jquery-ui' . $min . '.js';
-      jquery_update_jqueryui_cdn($cdn, &$javascript, $path, $min, $names);
-      jquery_update_jqueryui_backup($javascript, $path, $min);
+      jquery_update_jqueryui_cdn($cdn, &$libraries, $path, $min, $names);
+      jquery_update_jqueryui_backup($libraries, $path, $min);
       break;
     case 'none':
-      jquery_update_jqueryui_local(&$javascript, $path, $min, $names);
+      jquery_update_jqueryui_local(&$libraries, $path, $min, $names);
       break;
   }
 }
@@ -213,16 +212,16 @@ function jquery_update_jqueryui_replace(&$javascript, $cdn, $path, $min) {
 /**
  * Add the local fallback in case jQuery UI from the CDN is unavailable.
  *
- * @param array $javascript
+ * @param array $libraries
  *   The $libraries array as seen in hook_library_alter()
  * @param string $path
  *   The path to the module where replacements can be found.
  * @param string $min
  *   The '.min' to include in the file name if we are requesting a minified version.
  */
-function jquery_update_jqueryui_backup(&$javascript, $path, $min) {
+function jquery_update_jqueryui_backup(&$libraries, $path, $min) {
   $js_path = ($min == '.min') ? '/replace/ui/ui/minified/jquery-ui.min.js' : '/replace/ui/ui/jquery-ui.js';
-  $javascript['ui']['js'][] = array(
+  $libraries['ui']['js'][] = array(
     'data' => 'window.jQuery.ui || document.write("<script src=\'' . base_path() . $path . $js_path . '\'>\x3C/script>")',
     'type' => 'inline',
     'group' => JS_LIBRARY,
@@ -233,7 +232,7 @@ function jquery_update_jqueryui_backup(&$javascript, $path, $min) {
 /**
  * Handle when jQuery UI is updated to the cdn version.
  *
- * @param array $javascript
+ * @param array $libraries
  *   The $libraries array as seen in hook_library_alter()
  * @param string $path
  *   The path to the module where replacements can be found.
@@ -242,19 +241,18 @@ function jquery_update_jqueryui_backup(&$javascript, $path, $min) {
  * @param array $names
  *   An array mapping jquery ui parts to their file names.
  */
-function jquery_update_jqueryui_cdn($cdn, &$javascript, $path, $min, $names) {
-
+function jquery_update_jqueryui_cdn($cdn, &$libraries, $path, $min, $names) {
   // Construct the jQuery UI path and replace the JavaScript.
   $jspath = $path . '/replace/ui/ui/' . ($min == '.min' ? 'minified/' : '');
   foreach ($names as $name => $file) {
     $corefile = 'misc/ui/jquery.' . $file . '.min.js';
     // Remove the core files.
-    unset($javascript[$name]['js'][$corefile]);
-    $javascript[$name]['version'] = '1.8.11';
+    unset($libraries[$name]['js'][$corefile]);
+    $libraries[$name]['version'] = '1.8.11';
   }
 
   // UI is used by all of UI. Add the js cdn here.
-  $javascript['ui']['js'][$cdn] = array(
+  $libraries['ui']['js'][$cdn] = array(
     'data' => $cdn,
     'type' => 'external',
     'group' => JS_LIBRARY,
@@ -265,7 +263,7 @@ function jquery_update_jqueryui_cdn($cdn, &$javascript, $path, $min, $names) {
 /**
  * Handle when jQuery UI is updated to the local version.
  *
- * @param array $javascript
+ * @param array $libraries
  *   The $libraries array as seen in hook_library_alter()
  * @param string $path
  *   The path to the module where replacements can be found.
@@ -274,13 +272,12 @@ function jquery_update_jqueryui_cdn($cdn, &$javascript, $path, $min, $names) {
  * @param array $names
  *   An array mapping jquery ui parts to their file names.
  */
-function jquery_update_jqueryui_local(&$javascript, $path, $min, $names) {
-
+function jquery_update_jqueryui_local(&$libraries, $path, $min, $names) {
   // Construct the jQuery UI path and replace the JavaScript.
   $jspath = $path . '/replace/ui/ui/' . ($min == '.min' ? 'minified/' : '');
   foreach ($names as $name => $file) {
     $corefile = 'misc/ui/jquery.' . $file . '.min.js';
-    $javascript[$name]['js'][$corefile]['data'] = $jspath . 'jquery.' . $file . $min . '.js';
-    $javascript[$name]['version'] = '1.8.11';
+    $libraries[$name]['js'][$corefile]['data'] = $jspath . 'jquery.' . $file . $min . '.js';
+    $libraries[$name]['version'] = '1.8.11';
   }
 }
