diff --git a/libraries.module b/libraries.module
index 929b8ef..e4d7249 100644
--- a/libraries.module
+++ b/libraries.module
@@ -9,6 +9,10 @@
  * Implements hook_flush_caches().
  */
 function libraries_flush_caches() {
+  // Clear all static caches.
+  foreach (array('libraries_get_path', 'libraries_info', 'libraries_load') as $name) {
+    drupal_static_reset($name);
+  }
   return array('cache_libraries');
 }
 
diff --git a/tests/libraries.test b/tests/libraries.test
index 6ff9296..e4a70ab 100644
--- a/tests/libraries.test
+++ b/tests/libraries.test
@@ -328,7 +328,7 @@ class LibrariesTestCase extends DrupalWebTestCase {
     $this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>');
     $this->assertEqual($library, $expected, 'Load callback was applied correctly.');
     // This is not recommended usually and is only used for testing purposes.
-    drupal_static_reset('libraries_load');
+    libraries_flush_caches();
     // Successfully loaded library variants are supposed to contain the specific
     // variant information only.
     $expected['info callback'] = 'applied (version 1, variant example_variant)';
