Index: tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImporter.groovy
===================================================================
--- tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImporter.groovy	(revision 2229)
+++ tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImporter.groovy	(revision 2230)
@@ -49,9 +49,7 @@
 		
 		def xmlFiles = [] // the TIGER XML files
 		if (!master.exists() ) {
-			master = new File(sourceDirectory, "master.xml")
-		}
-		if (!master.exists() ) {
+			println "No main.xml ($master) file found, trying to find a proper TIGER XML file."
 //			master = new File(sourceDirectory, "main.xml")
 //			String subcorpora = "";
 			xmlFiles = sourceDirectory.listFiles(new FileFilter() {
@@ -76,13 +74,18 @@
 				isSuccessFul = false;
 				return;
 			}
-			println "No TIGER XML 'main.xml' file found. Using $xmlFiles as TIGER XML source file "
+			println "Using ${xmlFiles.get(0)} as TIGER XML source file ".
 			
 		} else { // parse the master file
 			for (def s : new XmlSlurper().parse(master).body.subcorpus) {
 				String name = ""+s.@external
 				if (name.startsWith("file:")) {
-					xmlFiles << new File(sourceDirectory, name.substring(5))
+					File f = new File(sourceDirectory, name.substring(5));
+					if (f.exists()) {
+						xmlFiles << f
+					} else {
+						println "Warning: $name referenced file was nto found: $f"
+					}
 				}
 			}
 			
@@ -99,8 +102,8 @@
 
 		File xmltxmSrcDir = new File(binaryDirectory, "src"); // output directory of the TS XSL transformation
 		xmltxmSrcDir.mkdirs();
-		println "Main.xml files: "+xmlFiles
-		println "N="+xmlFiles.size()
+		if (master.exists()) println "TIGER MAIN file: $master" 
+		println "TIGER XML files: $xmlFiles"
 		for (File xmlTigerFile : xmlFiles) {
 			FileCopy.copy(xmlTigerFile, new File(xmltxmSrcDir, xmlTigerFile.getName()));
 		}
@@ -127,5 +130,12 @@
 		for (def f : xmlFiles) module.orderedFiles.add(new File(outputDirectory, f.getName()))
 		
 		isSuccessFul = outputDirectory.listFiles(IOUtils.HIDDENFILE_FILTER).size() > 0
+		
+		String cleanDirectories = project.getCleanAfterBuild();
+		if ("true".equals(cleanDirectories)) {
+			new File(module.getBinaryDirectory(), "tokenized").deleteDir()
+			new File(module.getBinaryDirectory(), "src").deleteDir()
+			new File(module.getBinaryDirectory(), "split").deleteDir()
+		}
 	}
 }
Index: tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImport.groovy
===================================================================
--- tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImport.groovy	(revision 2229)
+++ tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImport.groovy	(revision 2230)
@@ -99,8 +99,8 @@
 		}
 	}
 	
-	ArrayList<File> orderedFiles= null;
-	protected ArrayList<File> getTXMFilesOrder() {
+	ArrayList<String> orderedFiles= null;
+	protected ArrayList<String> getTXMFilesOrder() {
 		orderedFiles;
 	}
 }
\ No newline at end of file
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java	(revision 2229)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java	(revision 2230)
@@ -253,6 +253,10 @@
 		}
 	}
 
+	/**
+	 * 
+	 * @return 1..N sentences
+	 */
 	public int getNSent() {
 		return this.sentSpinner.getSelection();
 	}
@@ -328,8 +332,8 @@
 
 		String T = TCombo.getText();
 		String NT = NTCombo.getText();
-		int sent = sentSpinner.getSelection();
-		int sub = subSpinner.getSelection();
+		int sent = sentSpinner.getSelection() -1;
+		int sub = subSpinner.getSelection() -1;
 
 		if (ts == null) return false; // no result
 		if (!ts.isComputed()) return false;
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 2229)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 2230)
@@ -95,7 +95,7 @@
 		try {
 			// iterate to the sub th subgraph
 			TSMatch match = tsresult.getMatch(sent);
-			match.setSubGraph(sub-1);
+			match.setSubGraph(sub);
 			svgFile.delete();
 			match.toSVGFile(svgFile);
 			if (!svgFile.exists()) {
