diff --git a/src/main/jastadd/base/export/ComplexElementsConverter.jadd b/src/main/jastadd/base/export/ComplexElementsConverter.jadd
index de231e85fad520f181222269d09276c68829434d..0b0e6d804b251fc43409bcb83a9df1ac6bb4c415 100644
--- a/src/main/jastadd/base/export/ComplexElementsConverter.jadd
+++ b/src/main/jastadd/base/export/ComplexElementsConverter.jadd
@@ -50,7 +50,8 @@ aspect ComplexElementsConverter{
                 }
 
                 for (int i = 0; i < petriNet.getNumToolspecific(); i++) {
-                    if (petriNet.getToolspecific(i).getFormattedXMLBuffer().indexOf("</toolspecific>") > -1) {
+                    if (petriNet.getToolspecific(i).getFormattedXMLBuffer() != null &&
+                            petriNet.getToolspecific(i).getFormattedXMLBuffer().indexOf("</toolspecific>") > -1) {
 
                         pn.addToolspecificsHLAPI(new ToolInfoHLAPI(petriNet.getToolspecific(i).getTool(), petriNet.getToolspecific(i).getVersion(),
                                 clipToolSpecificsFormattedXmlBuffer(petriNet.getToolspecific(i).getTool(), petriNet.getToolspecific(i).getVersion(),
diff --git a/src/main/jastadd/base/parsing/ToolSpecificsParser.jadd b/src/main/jastadd/base/parsing/ToolSpecificsParser.jadd
index 1a05ee56ebfdcf1da8505df109dd88a5ae7f6413..d1c5868fd2615f92cefaafe74c17c1fd81731302 100644
--- a/src/main/jastadd/base/parsing/ToolSpecificsParser.jadd
+++ b/src/main/jastadd/base/parsing/ToolSpecificsParser.jadd
@@ -158,6 +158,11 @@ aspect ToolSpecificsParser{
 
             try {
                 Document doc = parseToolSpecifics(toolInfos);
+
+                if(doc == null){
+                    return inputSignalDefs;
+                }
+
                 org.w3c.dom.NodeList sDefList = doc.getElementsByTagName(PnmlConstants.INPUT_SIGNALS_DEF);
 
                 if (sDefList.getLength() > 0 && sDefList.item(0) != null) {
@@ -496,6 +501,10 @@ aspect ToolSpecificsParser{
 
         private static Document parseToolSpecifics(JastAddList<ToolInfo> toolInfos) throws ParserConfigurationException, SAXException, IOException {
 
+            if (toolInfos == null || toolInfos.getNumChild() == 0 || toolInfos.getChild(0).getFormattedXMLBuffer() == null) {
+                return null;
+            }
+
             ToolInfo ti = null;
 
             for (ToolInfo toolInfo : toolInfos) {
diff --git a/src/main/resources/nets/sample/TestNet1.pnml b/src/main/resources/nets/test_flattener/TestNet1.pnml
similarity index 100%
rename from src/main/resources/nets/sample/TestNet1.pnml
rename to src/main/resources/nets/test_flattener/TestNet1.pnml
diff --git a/src/main/resources/nets/sample/TestNet2.pnml b/src/main/resources/nets/test_flattener/TestNet2.pnml
similarity index 91%
rename from src/main/resources/nets/sample/TestNet2.pnml
rename to src/main/resources/nets/test_flattener/TestNet2.pnml
index 3ceccacf1e0d8ce420d267b8e43f5e3da2cf5466..5b1e840dbdaa6596968648fb49eca9a7ab49e0df 100644
--- a/src/main/resources/nets/sample/TestNet2.pnml
+++ b/src/main/resources/nets/test_flattener/TestNet2.pnml
@@ -6,16 +6,6 @@
             <text>ServiceNet</text>
         </name>
         <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
-       <!--     <communicators>
-                <communicator>
-                    <cType>serviceClient</cType>
-                    <cSubnet>s1</cSubnet>
-                </communicator>
-                <communicator>
-                    <cType>serviceServer</cType>
-                    <cSubnet>s2</cSubnet>
-                </communicator>
-            </communicators>-->
         </toolspecific>
         <page id="top">
             <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
@@ -62,7 +52,7 @@
                     <serviceName>sampleService</serviceName>
                     <serverInput>serverIn</serverInput>
                     <serverOutput>serverOut</serverOutput>
-                    <serverCapacity>16</serverCapacity>
+                    <serverCapacity>1</serverCapacity>
                     <channels>
                         <channel>
                             <cid>c1</cid>
@@ -119,4 +109,4 @@
             </page>
         </page>
     </net>
-</pnml>
\ No newline at end of file
+</pnml>
diff --git a/src/main/resources/nets/test_flattener/TestNet2_Cyclic.pnml b/src/main/resources/nets/test_flattener/TestNet2_Cyclic.pnml
new file mode 100644
index 0000000000000000000000000000000000000000..3c36108c0b51f0759bac4aba27904b463844d41b
--- /dev/null
+++ b/src/main/resources/nets/test_flattener/TestNet2_Cyclic.pnml
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pnml
+        xmlns="http://www.pnml.org/version-2009/grammar/pnml">
+    <net id="n-E2D0-BCF46-0" type="http://www.pnml.org/version-2009/grammar/ptnet">
+        <name>
+            <text>ServiceNet</text>
+        </name>
+        <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+        </toolspecific>
+        <page id="top">
+            <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                <type>dinerosPage</type>
+            </toolspecific>
+            <page id="sourcePage">
+                <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                    <type>serverPrototype</type>
+                    <serviceName>sampleService0</serviceName>
+                </toolspecific>
+                <place id="serverIn0">
+                    <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                        <node>n2</node>
+                        <subnet>s2</subnet>
+                    </toolspecific>
+                    <name>
+                        <text>serverIn0</text>
+                        <graphics>
+                            <offset x="0" y="0" />
+                        </graphics>
+                    </name>
+                    <graphics>
+                        <position x="0" y="0" />
+                    </graphics>
+                </place>
+                <place id="serverOut0">
+                    <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                        <node>n2</node>
+                        <subnet>s2</subnet>
+                    </toolspecific>
+                    <name>
+                        <text>serverOut0</text>
+                        <graphics>
+                            <offset x="0" y="0" />
+                        </graphics>
+                    </name>
+                    <graphics>
+                        <position x="0" y="0" />
+                    </graphics>
+                </place>
+                <place id="req0">
+                    <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                        <node>n1</node>
+                        <subnet>s1</subnet>
+                    </toolspecific>
+                    <name>
+                        <text>req0</text>
+                        <graphics>
+                            <offset x="0" y="0" />
+                        </graphics>
+                    </name>
+                    <graphics>
+                        <position x="0" y="0" />
+                    </graphics>
+                </place>
+                <place id="res0">
+                    <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                        <node>n1</node>
+                        <subnet>s1</subnet>
+                    </toolspecific>
+                    <name>
+                        <text>res0</text>
+                        <graphics>
+                            <offset x="0" y="0" />
+                        </graphics>
+                    </name>
+                    <graphics>
+                        <position x="0" y="0" />
+                    </graphics>
+                </place>
+            </page>
+            
+            <transition id="serviceTransition0">
+                <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                    <type>serviceTransitionType</type>
+                    <serviceName>sampleService0</serviceName>
+                    <serverInput>serverIn0</serverInput>
+                    <serverOutput>serverOut0</serverOutput>
+                    <serverCapacity>1</serverCapacity>
+                    <channels>
+                        <channel>
+                            <cid>c1</cid>
+                            <request>req1</request>
+                            <response>res1</response>
+                        </channel>
+                    </channels>
+                </toolspecific>
+                <name>
+                    <text>serviceTransition0</text>
+                    <graphics>
+                        <offset x="0" y="0" />
+                    </graphics>
+                </name>
+                <graphics>
+                    <position x="0" y="0" />
+                </graphics>
+            </transition>
+            <transition id="serviceTransition1">
+                <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                    <type>serviceTransitionType</type>
+                    <serviceName>sampleService1</serviceName>
+                    <serverInput>serverIn1</serverInput>
+                    <serverOutput>serverOut1</serverOutput>
+                    <serverCapacity>1</serverCapacity>
+                    <channels>
+                        <channel>
+                            <cid>c1</cid>
+                            <request>req0</request>
+                            <response>res0</response>
+                        </channel>
+                    </channels>
+                </toolspecific>
+                <name>
+                    <text>serviceTransition1</text>
+                    <graphics>
+                        <offset x="0" y="0" />
+                    </graphics>
+                </name>
+                <graphics>
+                    <position x="0" y="0" />
+                </graphics>
+            </transition>
+            
+            <page id="targetPage">
+                <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                    <type>serverPrototype</type>
+                    <serviceName>sampleService1</serviceName>
+                </toolspecific>
+                <place id="serverIn1">
+                    <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                        <node>n2</node>
+                        <subnet>s2</subnet>
+                    </toolspecific>
+                    <name>
+                        <text>serverIn1</text>
+                        <graphics>
+                            <offset x="0" y="0" />
+                        </graphics>
+                    </name>
+                    <graphics>
+                        <position x="0" y="0" />
+                    </graphics>
+                </place>
+                <place id="serverOut1">
+                    <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                        <node>n2</node>
+                        <subnet>s2</subnet>
+                    </toolspecific>
+                    <name>
+                        <text>serverOut1</text>
+                        <graphics>
+                            <offset x="0" y="0" />
+                        </graphics>
+                    </name>
+                    <graphics>
+                        <position x="0" y="0" />
+                    </graphics>
+                </place>
+                <place id="req1">
+                    <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                        <node>n1</node>
+                        <subnet>s1</subnet>
+                    </toolspecific>
+                    <name>
+                        <text>req1</text>
+                        <graphics>
+                            <offset x="0" y="0" />
+                        </graphics>
+                    </name>
+                    <graphics>
+                        <position x="0" y="0" />
+                    </graphics>
+                </place>
+                <place id="res1">
+                    <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                        <node>n1</node>
+                        <subnet>s1</subnet>
+                    </toolspecific>
+                    <name>
+                        <text>res1</text>
+                        <graphics>
+                            <offset x="0" y="0" />
+                        </graphics>
+                    </name>
+                    <graphics>
+                        <position x="0" y="0" />
+                    </graphics>
+                </place>
+                
+            </page>
+        </page>
+    </net>
+</pnml>
diff --git a/src/main/resources/nets/sample/TestNet3.pnml b/src/main/resources/nets/test_flattener/TestNet3.pnml
similarity index 77%
rename from src/main/resources/nets/sample/TestNet3.pnml
rename to src/main/resources/nets/test_flattener/TestNet3.pnml
index 15362bcc04e506315fa80a9aa76dc83e6178d864..fdb65745171c73f136baa1a497038a00f013d302 100644
--- a/src/main/resources/nets/sample/TestNet3.pnml
+++ b/src/main/resources/nets/test_flattener/TestNet3.pnml
@@ -16,6 +16,14 @@
                     <inputsignalID>is2</inputsignalID>
                     <initialvalue>false</initialvalue>
                 </inputsignal>
+                <inputsignal>
+                    <inputsignalID>is3</inputsignalID>
+                    <initialvalue>true</initialvalue>
+                </inputsignal>
+                <inputsignal>
+                    <inputsignalID>is4</inputsignalID>
+                    <initialvalue>false</initialvalue>
+                </inputsignal>
             </inputsignals>
         </toolspecific>
         <page id="top">
@@ -24,7 +32,7 @@
                     <node>n1</node>
                     <subnet>s1</subnet>
                     <type>discreteTransitionType</type>
-                    <inputsignalclause>(is1 OR NOT is2) AND (is1 OR is2)</inputsignalclause>
+                    <inputsignalclause>(is1 OR NOT is2) AND (is3 OR is4)</inputsignalclause>
                 </toolspecific>
                 <name>
                     <text>transition</text>
diff --git a/src/main/resources/nets/test_flattener/TestNet3_Multi.pnml b/src/main/resources/nets/test_flattener/TestNet3_Multi.pnml
new file mode 100644
index 0000000000000000000000000000000000000000..86365f807f30915579e5297ba57c391efda67cb3
--- /dev/null
+++ b/src/main/resources/nets/test_flattener/TestNet3_Multi.pnml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pnml
+        xmlns="http://www.pnml.org/version-2009/grammar/pnml">
+    <net id="n-E2D0-BCF46-0" type="http://www.pnml.org/version-2009/grammar/ptnet">
+        <name>
+            <text>SignalNet</text>
+        </name>
+        <!-- read via attribute -->
+        <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+            <inputsignals>
+                <inputsignal>
+                    <inputsignalID>is1</inputsignalID>
+                    <initialvalue>true</initialvalue>
+                </inputsignal>
+            </inputsignals>
+        </toolspecific>
+        <page id="top">
+            <transition id="t1">
+                <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                    <node>n1</node>
+                    <subnet>s1</subnet>
+                    <type>discreteTransitionType</type>
+                    <inputsignalclause>(is1)</inputsignalclause>
+                </toolspecific>
+                <name>
+                    <text>t1</text>
+                </name>
+            </transition>
+            <transition id="t2">
+                <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
+                    <node>n1</node>
+                    <subnet>s1</subnet>
+                    <type>discreteTransitionType</type>
+                    <inputsignalclause>(is1)</inputsignalclause>
+                </toolspecific>
+                <name>
+                    <text>t2</text>
+                </name>
+            </transition>
+        </page>
+    </net>
+</pnml>
diff --git a/src/main/resources/nets/sample/TestNet4.pnml b/src/main/resources/nets/test_flattener/TestNet4.pnml
similarity index 92%
rename from src/main/resources/nets/sample/TestNet4.pnml
rename to src/main/resources/nets/test_flattener/TestNet4.pnml
index 5ea8aa7f67a9862735d5f0940eeb1edd066b11f2..9b760edd5a831ed043dcb01871cdcbcb9641f196 100644
--- a/src/main/resources/nets/sample/TestNet4.pnml
+++ b/src/main/resources/nets/test_flattener/TestNet4.pnml
@@ -6,24 +6,6 @@
             <text>ServiceNet2</text>
         </name>
         <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
-      <!--      <communicators>
-                <communicator>
-                    <cType>serviceClient</cType>
-                    <cSubnet>s1</cSubnet>
-                </communicator>
-                <communicator>
-                    <cType>serviceClient</cType>
-                    <cSubnet>s2</cSubnet>
-                </communicator>
-                <communicator>
-                    <cType>serviceServer</cType>
-                    <cSubnet>s2</cSubnet>
-                </communicator>
-                <communicator>
-                    <cType>serviceServer</cType>
-                    <cSubnet>s3</cSubnet>
-                </communicator>
-            </communicators>-->
         </toolspecific>
         <page id="top">
             <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
@@ -220,4 +202,4 @@
             </page>
         </page>
     </net>
-</pnml>
\ No newline at end of file
+</pnml>