diff --git a/src/var/FeatureModelImplGenerator/src/ModelSetup.java b/src/var/FeatureModelImplGenerator/src/ModelSetup.java
index 4545982ff23b231ffe5a64cbc188e8fd06a49302..dacfab2d4ed0b5ce1b2ad7aadcc208c34ff68e93 100644
--- a/src/var/FeatureModelImplGenerator/src/ModelSetup.java
+++ b/src/var/FeatureModelImplGenerator/src/ModelSetup.java
@@ -50,9 +50,18 @@ public class ModelSetup extends XMLHelper{
 			String out_mName = getConfigVal(ModelSetupConfig, "output/model", "name");
 			
 			Document model = readXml(in_mPath+in_mName);
-
+			
+			//Get sensorconfig- and gazebomodel file names.
+			//All files in in_scPath will be treated as sensorconfigs, while in_gmPath may
+			//contain other files that will be filtered out!
 			List<String> scList = getFileNames(in_scPath);
-			List<String> gmList = getFileNames(in_gmPath);
+			List<String> tmpList = getFileNames(in_gmPath);
+			List<String> gmList = new ArrayList<String>();
+			for(String s : tmpList) {
+				if(s.endsWith(GM_ENDING)) {
+					gmList.add(s);
+				}
+			}
 			
 			//Check whether feature input was empty.
 			//It is possible to have no sensors (so you can build a custom bot with no sensors), 
@@ -72,12 +81,6 @@ public class ModelSetup extends XMLHelper{
 					System.exit(-1);
 				}
 			}
-			for(String gm : gmList) {
-				if(!gm.endsWith(GM_ENDING)) {
-					System.err.println("Error: gazebo model file \'"+gm+"\' does not have an \'"+GM_ENDING+"\' ending.");
-					System.exit(-1);
-				}
-			}
 			
 			//Sort features alphabetically (ascending order; upper case first; then lower case).
 			Collections.sort(scList);