diff --git a/libraries.module b/libraries.module
index 7bacfdc..3e91f01 100644
--- a/libraries.module
+++ b/libraries.module
@@ -212,7 +212,7 @@ function libraries_info($name = NULL) {
 }
 
 /**
- * Detect libraries and library versions.
+ * Tries to detect a library and its installed version.
  *
  * @todo We need to figure out whether, and if, how we want to retain the
  *   processed information. I.e. either use a static cache here, or make
@@ -224,26 +224,27 @@ function libraries_info($name = NULL) {
  *   supported libraries (possibly those registered by itself, or in a certain
  *   "category") is available... Food for thought.
  *
- * @param $libraries
- *   An array of libraries to detect, as returned from libraries_info().
+ * @param $name
+ *   The machine name of a library to return registered information for.
+ *
+ * @return
+ *   An associative array containing registered information for the library
+ *   specified by $name. In addition to the keys returned by libraries_info()
+ *   libraries contain the following keys:
+ *   - installed: A boolean indicating whether the library is installed. Note
+ *     that not only the top-level library, but also each variant contains this
+ *     key.
+ *   - version: If the version could be detected, the full version string.
+ *   - error: If an error occurred during library detection, one of the
+ *     following error statuses: "not found", "not detected", "not supported".
+ *   - error message: If an error occurred during library detection, a detailed
+ *     error message.
  *
  * @see libraries_info()
  */
-function libraries_detect($libraries) {
-  foreach ($libraries as &$library) {
-    libraries_detect_library($library);
-  }
-  return $libraries;
-}
+function libraries_detect($name) {
+  $library = libraries_info($name);
 
-/**
- * Tries to detect a library and its installed version.
- *
- * @param $library
- *   An associative array describing a single library, as returned from
- *   libraries_info().
- */
-function libraries_detect_library(&$library) {
   $library['installed'] = FALSE;
 
   // Check whether the library exists.
@@ -255,7 +256,7 @@ function libraries_detect_library(&$library) {
     $library['error message'] = t('The %library library could not be found.', array(
       '%library' => $library['name'],
     ));
-    return;
+    return $library;
   }
 
   // Detect library version, if not hardcoded.
@@ -274,7 +275,7 @@ function libraries_detect_library(&$library) {
       $library['error message'] = t('The version of the %library library could not be detected.', array(
         '%library' => $library['name'],
       ));
-      return;
+      return $library;
     }
   }
 
@@ -293,7 +294,7 @@ function libraries_detect_library(&$library) {
         '%version' => $library['version'],
         '%library' => $library['name'],
       ));
-      return;
+      return $library;
     }
 
     // Apply version specific definitions and overrides.
@@ -359,8 +360,7 @@ function libraries_load($name, $variant = NULL) {
   $loaded = &drupal_static(__FUNCTION__, array());
 
   if (!isset($loaded[$name])) {
-    $library = libraries_info($name);
-    libraries_detect_library($library);
+    $library = libraries_detect($name);
 
     // If a variant was specified, override the top-level properties with the
     // variant properties.
diff --git a/tests/libraries.test b/tests/libraries.test
index 8451638..14a8690 100644
--- a/tests/libraries.test
+++ b/tests/libraries.test
@@ -59,8 +59,7 @@ class LibrariesTestCase extends DrupalWebTestCase {
     $this->assertEqual($library, $expected, 'Library specified with an .info file found');
 
     // Test missing library.
-    $library = libraries_info('example_missing');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_missing');
     $this->verbose(var_export($library, TRUE));
     $this->assertEqual($library['error'], 'not found', 'Missing library not found.');
     $error_message = t('The %library library could not be found.', array(
@@ -69,8 +68,7 @@ class LibrariesTestCase extends DrupalWebTestCase {
     $this->assertEqual($library['error message'], $error_message, 'Correct error message for a missing library.');
 
     // Test unknown library version.
-    $library = libraries_info('example_undetected_version');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_undetected_version');
     $this->verbose(var_export($library, TRUE));
     $this->assertEqual($library['error'], 'not detected', 'Undetected version detected as such.');
     $error_message = t('The version of the %library library could not be detected.', array(
@@ -79,8 +77,7 @@ class LibrariesTestCase extends DrupalWebTestCase {
     $this->assertEqual($library['error message'], $error_message, 'Correct error message for a library with an undetected version.');
 
     // Test unsupported library version.
-    $library = libraries_info('example_unsupported_version');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_unsupported_version');
     $this->verbose(var_export($library, TRUE));
     $this->assertEqual($library['error'], 'not supported', 'Unsupported version detected as such.');
     $error_message = t('The installed version %version of the %library library is not supported.', array(
@@ -90,26 +87,22 @@ class LibrariesTestCase extends DrupalWebTestCase {
     $this->assertEqual($library['error message'], $error_message, 'Correct error message for a library with an unsupported version.');
 
     // Test supported library version.
-    $library = libraries_info('example_supported_version');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_supported_version');
     $this->verbose(var_export($library, TRUE));
     $this->assertEqual($library['installed'], TRUE, 'Supported library version found.');
 
     // Test libraries_get_version().
-    $library = libraries_info('example_default_version_callback');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_default_version_callback');
     $this->verbose(var_export($library, TRUE));
     $this->assertEqual($library['version'], '1', 'Expected version returned by default version callback.');
 
     // Test a multiple-parameter version callback.
-    $library = libraries_info('example_multiple_parameter_version_callback');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_multiple_parameter_version_callback');
     $this->verbose(var_export($library, TRUE));
     $this->assertEqual($library['version'], '1', 'Expected version returned by multiple parameter version callback.');
 
     // Test a top-level files property.
-    $library = libraries_info('example_files');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_files');
     $files = array(
       'js' => array('example_1.js'),
       'css' => array('example_1.css'),
@@ -119,8 +112,7 @@ class LibrariesTestCase extends DrupalWebTestCase {
     $this->assertEqual($library['files'], $files, 'Top-level files property works.');
 
     // Test version-specific library files.
-    $library = libraries_info('example_versions');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_versions');
     $files = array(
       'js' => array('example_2.js'),
       'css' => array('example_2.css'),
@@ -130,8 +122,7 @@ class LibrariesTestCase extends DrupalWebTestCase {
     $this->assertEqual($library['files'], $files, 'Version-specific library files found.');
 
     // Test missing variant.
-    $library = libraries_info('example_variant_missing');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_variant_missing');
     $variants = array_keys($library['variants']);
     $this->verbose(var_export($library, TRUE));
     $this->assertEqual($library['variants']['example_variant']['error'], 'not found', 'Missing variant not found');
@@ -142,8 +133,7 @@ class LibrariesTestCase extends DrupalWebTestCase {
     $this->assertEqual($library['variants']['example_variant']['error message'], $error_message, 'Correct error message for a missing variant.');
 
     // Test existing variant.
-    $library = libraries_info('example_variant');
-    libraries_detect_library($library);
+    $library = libraries_detect('example_variant');
     $this->verbose(var_export($library, TRUE));
     $this->assertEqual($library['variants']['example_variant']['installed'], TRUE, 'Existing variant found.');
 
