diff --git a/fastqc.wdl b/fastqc.wdl
index d9135f73197bf1e985f5a096c45f449f37e42d94..635fa7493db98636d686e2cad05e7dbea7cb68a2 100644
--- a/fastqc.wdl
+++ b/fastqc.wdl
@@ -16,7 +16,7 @@ task fastqc {
     Int? kmers
     String? dir
     # Chops of the .gz extension if present.
-    String name = sub(seqFile, "\\.gz$","")
+    String name = sub(sub(seqFile, "\\.gz$",""), "\\.fq$|\\.fastq$","")
     # This regex chops of the extension and replaces it with _fastqc for the reportdir.
     # Just as fastqc does it.
     String reportDir = outdirPath + "/" + sub(basename(name), "\\.[^\\.]*$", "_fastqc")
@@ -44,9 +44,9 @@ task fastqc {
     }
 
     output {
-        File rawReport = reportDir + "/fastqc_data.txt"
-        File htmlReport = reportDir + "/fastqc_report.html"
-        File summary = reportDir + "/summary.txt"
+        File rawReport = select_first(glob(outdirPath + "/" + name + "*_fastqc/fastqc_data.txt"))
+        File htmlReport = select_first(glob(outdirPath + "/" + name + "*_fastqc/fastqc_report.html"))
+        File summary = select_first(glob(outdirPath + "/" + name + "*_fastqc/summary.txt"))
         Array[File] images = glob(reportDir + "/Images/*.png")
     }