diff --git a/project_issue.info b/project_issue.info
index 45ddfae..2dc08f6 100644
--- a/project_issue.info
+++ b/project_issue.info
@@ -39,6 +39,7 @@ files[] = tests/project_issue.test
 files[] = tests/integration/issue_creation.test
 files[] = tests/integration/maintainers.test
 files[] = tests/integration/issue_notifications.test
+files[] = tests/integration/issue_autocomplete.test
 
 files[] = views/plugins/project_issue_table_plugin_style.inc
 files[] = views/plugins/project_issue_plugin_access_per_user_queue.inc
diff --git a/project_issue.module b/project_issue.module
index f952611..b1a5e8f 100644
--- a/project_issue.module
+++ b/project_issue.module
@@ -176,15 +176,14 @@ function project_issue_menu() {
 
 /**
  * Implementation of hook_menu_alter().
- *
- * A project_issue node requires a parent project, and also that a "component"
- * of that project is specified.  In order to have the pull-down for the
- * component be properly populated, we hook 'node/add/project-issue' and
- * have the user select a project there, and then a form on
- * 'node/add/project-issue/<projectname>' has the component widget properly
- * constructed.
  */
 function project_issue_menu_alter(&$items) {
+  // A project_issue node requires a parent project, and also that a "component"
+  // of that project is specified.  In order to have the pull-down for the
+  // component be properly populated, we hook 'node/add/project-issue' and
+  // have the user select a project there, and then a form on
+  // 'node/add/project-issue/<projectname>' has the component widget properly
+  // constructed.
   foreach (project_issue_issue_node_types() as $issue_type) {
     $type_url_str = str_replace('_', '-', $issue_type);
     $items['node/add/' . $type_url_str]['page callback'] = 'drupal_get_form';
@@ -192,6 +191,11 @@ function project_issue_menu_alter(&$items) {
     $items['node/add/' . $type_url_str]['file'] = 'issue_node_add.inc';
     $items['node/add/' . $type_url_str]['file path'] = drupal_get_path('module', 'project_issue') . '/includes';
   }
+
+  // Override the taxonomy autocomplete route for any taxonomy term fields
+  // with the naming scheme "taxonomy_vocabulary_[vid]" where the vocabulary
+  //they reference has project issue enabled. This allows us to override the sorting
+  // for the data returned.
   foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
     if (variable_get('project_issue_taxonomy_vocabulary_issue_queue_' . $vid, 0) === 'autocomplete') {
       $items['taxonomy/autocomplete/taxonomy_vocabulary_' . $vid] = array(
@@ -2813,10 +2817,16 @@ function project_issue_default_component_allowed_values($field, $instance, $enti
 function project_issue_issue_tag_autocomplete($vid, $tags_typed = '') {
   // Issues tag taxonomy vocabulary name
   $field_name = 'taxonomy_vocabulary_' . $vid;
-  // If the request has a '/' in the search text, then the menu system will have
-  // split it into multiple arguments, recover the intended $tags_typed.
+
+  // The menu system can send an unknown number of arguments if a '/' was in
+  // the search string.
   $args = func_get_args();
 
+  // The first argument is $vid, which is not part of the search. Remove it.
+  unset($args[0]);
+
+  // If the menu system split the search into multiple arguments because '/' was
+  // part of the search, restore the original search.
   $tags_typed = implode('/', $args);
 
   // Make sure the field exists and is a taxonomy field.
diff --git a/tests/integration/issue_autocomplete.test b/tests/integration/issue_autocomplete.test
new file mode 100644
index 0000000..75c3f74
--- /dev/null
+++ b/tests/integration/issue_autocomplete.test
@@ -0,0 +1,127 @@
+<?php
+
+class ProjectIssueAutocompleteTestCase extends DrupalWebTestCase {
+  protected $admin_user;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Project issue autocomplete',
+      'description' => 'Test field autocomplete modifications.',
+      'group' => 'Project Issue',
+    );
+  }
+
+  protected function setUp() {
+    parent::setUp(array('project_issue'));
+
+    $perms = array(
+      'administer taxonomy',
+      'administer content types',
+    );
+    $this->admin_user = $this->drupalCreateUser($perms);
+    $this->drupalLogin($this->admin_user);
+  }
+
+  /**
+   * Test the autocomplete field modifications.
+   */
+  function testProjectIssueAutocomplete() {
+    $vocabulary = new stdClass();
+    $vocabulary->name = 'Autocomplete Test';
+    $vocabulary->machine_name = 'project_issue_test_vocab';
+    taxonomy_vocabulary_save($vocabulary);
+    $vocabulary = taxonomy_vocabulary_machine_name_load($vocabulary->machine_name);
+
+    // Enable this vocab for the issue queue, and have it use an autocomplete widget.
+    variable_set('project_issue_taxonomy_vocabulary_issue_queue_' . $vocabulary->vid, 'autocomplete');
+
+    // Rebuild menu router table so that the menu_alter hook can insert the proper
+    // autocomplete route override for the vocab we just added.
+    menu_rebuild();
+
+    $termA = new stdClass();
+    $termA->name = 'testA';
+    $termA->vid = $vocabulary->vid;
+    taxonomy_term_save($termA);
+
+    $termB = new stdClass();
+    $termB->name = 'testB';
+    $termB->vid = $vocabulary->vid;
+    taxonomy_term_save($termB);
+
+    $termC = new stdClass();
+    $termC->name = 'testC';
+    $termC->vid = $vocabulary->vid;
+    taxonomy_term_save($termC);
+
+    $field_1 = array(
+      'field_name' => 'taxonomy_vocabulary_' . $vocabulary->vid,
+      'type' => 'taxonomy_term_reference',
+      'cardinality' => FIELD_CARDINALITY_UNLIMITED,
+      'settings' => array(
+        'allowed_values' => array(
+          array(
+            'vocabulary' => $vocabulary->machine_name,
+            'parent' => 0,
+          ),
+        ),
+      ),
+    );
+    field_create_field($field_1);
+    $instance = array(
+      'field_name' => 'taxonomy_vocabulary_' . $vocabulary->vid,
+      'bundle' => 'article',
+      'entity_type' => 'node',
+      'widget' => array(
+        'type' => 'autocomplete',
+      ),
+    );
+    field_create_instance($instance);
+
+    // Create nodes in such a way that the usage of TermC is heaviest and TermA the lightest.
+    $this->drupalCreateNode(array(
+      'type' => 'article',
+      'taxonomy_vocabulary_' . $vocabulary->vid => array(
+        LANGUAGE_NONE => array(
+          array('tid' => $termA->tid),
+          array('tid' => $termB->tid),
+          array('tid' => $termC->tid),
+        ),
+      ),
+    ));
+    $this->drupalCreateNode(array(
+      'type' => 'article',
+      'taxonomy_vocabulary_' . $vocabulary->vid => array(
+        LANGUAGE_NONE => array(
+          array('tid' => $termB->tid),
+          array('tid' => $termC->tid),
+        ),
+      ),
+    ));
+    $this->drupalCreateNode(array(
+      'type' => 'article',
+      'taxonomy_vocabulary_' . $vocabulary->vid => array(
+        LANGUAGE_NONE => array(
+          array('tid' => $termC->tid),
+        ),
+      ),
+    ));
+
+    // The order of the terms returned should be based on usage of each term, with
+    // highest usage listed first.
+    $results = $this->drupalGet('taxonomy/autocomplete/taxonomy_vocabulary_' . $vocabulary->vid . '/test');
+    $expected = '{"testC":"testC","testB":"testB","testA":"testA"}';
+    $this->assertEqual($results, $expected);
+
+    $results = $this->drupalGet('taxonomy/autocomplete/taxonomy_vocabulary_foo');
+    $this->assertEqual($results, 'Taxonomy field taxonomy_vocabulary_foo not found.');
+
+    // Make sure that original sorting (seems to be alphabetical) still works when we no longer use
+    // this vocabulary for project issue.
+    variable_del('project_issue_taxonomy_vocabulary_issue_queue_' . $vocabulary->vid);
+    menu_rebuild();
+    $results = $this->drupalGet('taxonomy/autocomplete/taxonomy_vocabulary_' . $vocabulary->vid . '/test');
+    $expected = '{"testA":"testA","testB":"testB","testC":"testC"}';
+    $this->assertEqual($results, $expected);
+  }
+}
