diff --git a/src/emitted.py b/src/emitted.py
index 55142b0f2d98df41b35030a26bd7766d3a7f7c44..c3534add31ce5d4e46bc153c6858062bdaf3b934 100644
--- a/src/emitted.py
+++ b/src/emitted.py
@@ -45,7 +45,7 @@ class Emitted(Channel):
                         self.emits = o
         
         if(self.emits==None):
-            raise Exception(f"No emitted matched with '{name}' (in file '{self.get_file_address()}'). Should match with emittes from '{self.emitted_by.get_name()}' (in file '{self.emitted_by.get_file_address()}'")
+            raise Exception(f"No emitted matched with '{name}' (in file '{self.get_file_address()}'). Should match with emittes from '{self.emitted_by.get_first_element_called().get_name()}' (in file '{self.emitted_by.get_file_address()}'")
 
     def set_emits(self, input):
         thing_which_emits = self.emitted_by.get_first_element_called()
diff --git a/src/include.py b/src/include.py
index bfced507d5d7453586641bf7c322cf030522f092..fa111369e21c53e980768afbc1323a5f12d7fca0 100644
--- a/src/include.py
+++ b/src/include.py
@@ -79,7 +79,7 @@ class Include(Nextflow_Building_Blocks):
                 found_file = True
 
         if(not found_file and os.path.isfile(address[:-3]+"/main.nf")):
-            self.nextflow_file = Nextflow_File(address[:-3]+"/main.nf", origin=self)
+            self.nextflow_file = Nextflow_File(address[:-3]+"/main.nf", workflow = self.nextflow_file_origin.get_workflow())
         
         #TODO -> check if the nextflow_file is defined somewhere else? 
         #In the cas the nextflow file is imported multiple times
diff --git a/src/nextflow_file.py b/src/nextflow_file.py
index 6095fd0e3c79d6d816d5e4e85ecc9f2e39f1b4e2..8a5ab6344edab0311ee68f5f3a00d7f0b3d06c08 100644
--- a/src/nextflow_file.py
+++ b/src/nextflow_file.py
@@ -25,6 +25,7 @@ class Nextflow_File(Nextflow_Building_Blocks):
         self.address = address 
         self.workflow = workflow
         self.first_file = first_file
+        self.main = None
         self.workflow.add_nextflow_file_2_workflow(self)
         self.includes = []
         self.processes = []
diff --git a/src/operation.py b/src/operation.py
index 96087ff0b65d0bbe8d270c617d0f92a0d7218e44..29d383f12fab3ba81fedae2199bf29dd7b12c7f6 100644
--- a/src/operation.py
+++ b/src/operation.py
@@ -500,7 +500,11 @@ class Operation(Executor):
                     emited = self.check_is_emit(name)
                     if(not emited):
                         #TODO -> check at what extend this is used
-                        channels = self.get_channels_same_level()+self.get_channels_above_level()+self.get_channels_inside_level()+self.get_channels_from_other_blocks_on_same_level()
+                        #This is just a trick so i don't have to specifically define the methods for subworkflows
+                        thing = self
+                        if(self.origin.get_type()=="Subworkflow"):
+                            thing = self.origin.root
+                        channels = thing.get_channels_same_level()+thing.get_channels_above_level()+thing.get_channels_inside_level()+thing.get_channels_from_other_blocks_on_same_level()
                         for c in channels:
                             if(c.get_name() in name):
                                 pos = [m.start() for m in re.finditer(c.get_name(), operation)]
diff --git a/src/workflow.py b/src/workflow.py
index 5faf0d689b269f54f3cb582c707c0ddf8e86852f..cf52871ccdd4c148fcd076c3f7d8a89277041de6 100644
--- a/src/workflow.py
+++ b/src/workflow.py
@@ -161,7 +161,11 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
         if(self.get_DSL() == "DSL1"):
             return self.get_structure_DSL1(dico=dico)
         elif(self.get_DSL() == "DSL2"):
-            return self.get_workflow_main().get_structure(dico)
+            main = self.get_workflow_main()
+            if(main!=None):
+                return self.get_workflow_main().get_structure(dico)
+            else:
+                return dico
             #return self.get_structure_DSL2(dico=dico, start = True)
         else:
             raise Exception(f"The workflow's DSL is '{self.DSL}' -> I don't know what this is!")