diff --git a/fillpdf.module b/fillpdf.module
index f31dd1aa1a70c137b1903951017b1076381b194b..7f9207cd94d55b755b2f55304ca9ba908fd11992 100644
--- a/fillpdf.module
+++ b/fillpdf.module
@@ -185,36 +185,32 @@ function fillpdf_file_download($uri) {
       // your own module for more control.
       $usage = file_usage_list($file);
 
-      foreach ($usage as $module => $per_module) {
-        if ($module === 'fillpdf') {
-          foreach ($per_module as $type => $per_id) {
-            if ($type === 'fillpdf_form') {
-              // Only people who can manage forms can download the source forms.
-              if (user_access('administer pdfs')) {
-                return file_get_content_headers($file);
-              }
-            }
-            if ($type === 'fillpdf_file') {
-              foreach ($per_id as $id => $count) {
-                $raw_file_context = fillpdf_file_context_load($id);
-
-                if ($raw_file_context) {
-                  // Expand the stored link into a stub context (entities not
-                  // loaded).
-                  $stub_context = fillpdf_link_to_stub_context($raw_file_context);
-
-                  if ($stub_context['fid']) {
-                    // Expand the stub context (load the entities).
-                    $fillpdf_info = fillpdf_load($stub_context['fid']);
-                    $file_context = fillpdf_load_entities($fillpdf_info, $stub_context['nids'], $stub_context['webforms'], $stub_context['uc_order_ids'], $stub_context['uc_order_product_ids'], $GLOBALS['user'], $stub_context['entity_ids']);
-
-                    // Check access as if they were filling in the PDF from
-                    // scratch.
-                    if (fillpdf_merge_pdf_access($file_context['nodes'], $file_context['webforms'], $file_context['uc_orders'], $file_context['uc_order_products'])) {
-                      // We don't need to add any special headers.
-                      return file_get_content_headers($file);
-                    }
-                  }
+      foreach ($usage['fillpdf'] as $type => $per_id) {
+        if ($type === 'fillpdf_form') {
+          // Only people who can manage forms can download the source forms.
+          if (user_access('administer pdfs')) {
+            return file_get_content_headers($file);
+          }
+        }
+        if ($type === 'fillpdf_file') {
+          foreach ($per_id as $id => $count) {
+            $raw_file_context = fillpdf_file_context_load($id);
+
+            if ($raw_file_context) {
+              // Expand the stored link into a stub context (entities not
+              // loaded).
+              $stub_context = fillpdf_link_to_stub_context($raw_file_context);
+
+              if ($stub_context['fid']) {
+                // Expand the stub context (load the entities).
+                $fillpdf_info = fillpdf_load($stub_context['fid']);
+                $file_context = fillpdf_load_entities($fillpdf_info, $stub_context['nids'], $stub_context['webforms'], $stub_context['uc_order_ids'], $stub_context['uc_order_product_ids'], $GLOBALS['user'], $stub_context['entity_ids']);
+
+                // Check access as if they were filling in the PDF from
+                // scratch.
+                if (fillpdf_merge_pdf_access($file_context['nodes'], $file_context['webforms'], $file_context['uc_orders'], $file_context['uc_order_products'])) {
+                  // We don't need to add any special headers.
+                  return file_get_content_headers($file);
                 }
               }
             }