Index: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/Intersection.java
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/Intersection.java	(revision 2649)
+++ tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/Intersection.java	(revision 2650)
@@ -59,11 +59,12 @@
  * Command which creates a subcorpus from a Corpus @ author mdecorde.
  */
 public class Intersection extends AbstractHandler {
-
+	
 	/** The selection. */
 	private IStructuredSelection selection;
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
 	@Override
@@ -71,29 +72,30 @@
 		
 		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
 		if (selection == null) {
-			System.out.println(TXMUIMessages.noSelectionForColon+HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActiveEditor());
+			System.out.println(TXMUIMessages.noSelectionForColon + HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActiveEditor());
 			return null;
 		}
 		List list = selection.toList();
 		if (list.size() == 0) {
 			Log.info("No corpus selected");
 			return null;
-		} else if (list.size() != 1) {
+		}
+		else if (list.size() != 1) {
 			Log.info("Substraction need a selection of 1 corpus");
 			return null;
 		}
 		Object firstElement = list.get(0);
-//		Object secondElement = list.get(1);
+		// Object secondElement = list.get(1);
 		
 		if (!(firstElement instanceof CQPCorpus)) {
-			System.out.println(TXMUIMessages.selectionIsNotACorpusColon+firstElement);
+			System.out.println(TXMUIMessages.selectionIsNotACorpusColon + firstElement);
 			return null;
 		}
 		
-//		if (!(secondElement instanceof CQPCorpus)) {
-//			System.out.println(TXMUIMessages.selectionIsNotACorpusColon+secondElement);
-//			return null;
-//		}
+		// if (!(secondElement instanceof CQPCorpus)) {
+		// System.out.println(TXMUIMessages.selectionIsNotACorpusColon+secondElement);
+		// return null;
+		// }
 		
 		final CQPCorpus corpus = (CQPCorpus) firstElement;
 		try {
@@ -102,9 +104,10 @@
 		catch (InterruptedException e2) {
 			// TODO Auto-generated catch block
 			e2.printStackTrace();
+			return null;
 		}
-//		final CQPCorpus corpus2 = (CQPCorpus) secondElement;
-//		corpus2.compute(false);
+		// final CQPCorpus corpus2 = (CQPCorpus) secondElement;
+		// corpus2.compute(false);
 		
 		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
 		final SetOperationsDialog d = new SetOperationsDialog(shell, "INTER", corpus);
@@ -112,8 +115,9 @@
 		if (code == Window.OK) {
 			JobHandler jobhandler = new JobHandler(NLS.bind(
 					TXMUIMessages.creatingASubcorpusOnP0, corpus.getName())) {
+				
 				@Override
-				protected IStatus run(IProgressMonitor monitor) {		
+				protected IStatus run(IProgressMonitor monitor) {
 					this.runInit(monitor);
 					JobsTimer.start();
 					try {
@@ -123,18 +127,18 @@
 						if (name.length() == 0) {
 							name = d.getDefaultName();
 						}
-							
+						
 						AbstractCqiClient cqi = CQPSearchEngine.getCqiClient();
 						
-						String cqpid = "S"+Subcorpus.getNextSubcorpusCounter();
+						String cqpid = "S" + Subcorpus.getNextSubcorpusCounter();
 						CQPCorpus[] order = d.getCorpusOrder();
 						order[1].compute(false);
-						String query = cqpid+"=intersect "+order[0].getQualifiedCqpId()+" "+order[1].getQualifiedCqpId()+";";
-						System.out.println("QUERY="+query);
+						String query = cqpid + "=intersect " + order[0].getQualifiedCqpId() + " " + order[1].getQualifiedCqpId() + ";";
+						System.out.println("QUERY=" + query);
 						cqi.query(query);
-
-						System.out.println("END QUERY="+order[0].getMainCorpus()+":"+cqpid);
-						if (cqi.subCorpusSize(order[0].getMainCorpus()+":"+cqpid) == 0) {
+						
+						System.out.println("END QUERY=" + order[0].getMainCorpus() + ":" + cqpid);
+						if (cqi.subCorpusSize(order[0].getMainCorpus() + ":" + cqpid) == 0) {
 							Log.info("The created subcorpus was empty. Aborting.");
 							return Status.CANCEL_STATUS;
 						}
@@ -148,34 +152,39 @@
 						
 						System.out.println(NLS.bind(TXMUIMessages.doneColonP0Created, subcorpus.getName()));
 						monitor.worked(50);
-
+						
 						monitor.subTask(TXMUIMessages.refreshingCorpora);
-						final Subcorpus subcorpus2 = subcorpus; 
+						final Subcorpus subcorpus2 = subcorpus;
 						syncExec(new Runnable() {
+							
 							@Override
 							public void run() {
 								CorporaView.refresh();
 								CorporaView.expand(subcorpus2.getParent());
 							}
 						});
-
+						
 						monitor.worked(100);
-					} catch (ThreadDeath td) {
+					}
+					catch (ThreadDeath td) {
 						return Status.CANCEL_STATUS;
-					} catch (Exception e) {
+					}
+					catch (Exception e) {
 						org.txm.utils.logger.Log.printStackTrace(e);
 						Log.severe(e.toString());
 						
 						try {
 							System.out.println(NLS.bind(CQPSearchEngineCoreMessages.lastCQPErrorColon, CQPSearchEngine.getCqiClient().getLastCQPError()));
-						} catch (Exception e1) {
-							System.out.println(TXMUIMessages.failedToGetLastCQPErrorColon+e1);
+						}
+						catch (Exception e1) {
+							System.out.println(TXMUIMessages.failedToGetLastCQPErrorColon + e1);
 							org.txm.utils.logger.Log.printStackTrace(e1);
 						}
-					} finally {
+					}
+					finally {
 						monitor.done();
 						JobsTimer.stopAndPrint();
-					}				
+					}
 					return Status.OK_STATUS;
 				}
 			};
@@ -183,4 +192,4 @@
 		}
 		return null;
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/Union.java
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/Union.java	(revision 2649)
+++ tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/Union.java	(revision 2650)
@@ -104,6 +104,7 @@
 		catch (InterruptedException e2) {
 			// TODO Auto-generated catch block
 			e2.printStackTrace();
+			return null;
 		}
 		// final CQPCorpus corpus2 = (CQPCorpus) secondElement;
 		// corpus2.compute(false);
Index: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ExportCorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ExportCorpus.java	(revision 2649)
+++ tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ExportCorpus.java	(revision 2650)
@@ -76,12 +76,20 @@
 		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
 				.getShell();
 		
-		String txmhome = Toolbox.getTxmHomePath();
 		if (!(selection.getFirstElement() instanceof MainCorpus))
 			return null;
 		
 		final MainCorpus corpus = (MainCorpus) selection.getFirstElement();
 		
+		try {
+			corpus.compute(false);
+		}
+		catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			return null;
+		}
+		
 		if (corpus.isModified()) {
 			boolean ret = MessageDialog.openConfirm(shell, "Export - " + corpus.getName() + " annotations not saved",
 					"Do you wish to export without the current annotations?\n\n(to include the current annotations in the exported corpus, you need to save them before calling the \"Export\" command)");
Index: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/Substraction.java
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/Substraction.java	(revision 2649)
+++ tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/Substraction.java	(revision 2650)
@@ -104,6 +104,7 @@
 		catch (InterruptedException e2) {
 			// TODO Auto-generated catch block
 			e2.printStackTrace();
+			return null;
 		}
 		// final CQPCorpus corpus2 = (CQPCorpus) secondElement;
 		// corpus2.compute(false);
Index: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java	(revision 2649)
+++ tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java	(revision 2650)
@@ -20,80 +20,90 @@
 import org.txm.searchengine.cqp.corpus.Subcorpus;
 
 public class ComputeIntersection extends AbstractHandler {
-
+	
 	@Override
 	public void addHandlerListener(IHandlerListener handlerListener) {
 		super.addHandlerListener(handlerListener);
 	}
-
+	
 	@Override
 	public void dispose() {
 		super.dispose();
 	}
-
-
+	
+	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		ISelection isel = HandlerUtil.getCurrentSelection(event);
 		if (!(isel instanceof IStructuredSelection)) return null;
 		IStructuredSelection selection = (IStructuredSelection) isel;
 		List list = selection.toList();
-		ArrayList<Subcorpus> subcorpora = new ArrayList<Subcorpus>();
-		for (Object o : list) if (o instanceof Subcorpus) subcorpora.add((Subcorpus) o);
-
+		ArrayList<Subcorpus> subcorpora = new ArrayList<>();
+		for (Object o : list)
+			if (o instanceof Subcorpus) subcorpora.add((Subcorpus) o);
+		
 		if (subcorpora.size() != 2) {
-			System.out.println("Error: selection size != 2 : "+subcorpora.size());
+			System.out.println("Error: selection size != 2 : " + subcorpora.size());
 			return null;
 		}
-
-		HashSet<MainCorpus> set = new HashSet<MainCorpus>();
-		for (Subcorpus s : subcorpora) set.add(s.getMainCorpus());
+		
+		HashSet<MainCorpus> set = new HashSet<>();
+		for (Subcorpus s : subcorpora) {
+			set.add(s.getMainCorpus());
+			try {
+				s.compute(false);
+			}
+			catch (InterruptedException e) {
+				e.printStackTrace();
+				return null;
+			}
+		}
 		if (set.size() > 1) {
-			System.out.println("Error: selected subcorpus have different main corpus: "+set);
+			System.out.println("Error: selected subcorpus have different main corpus: " + set);
 			return null;
 		}
-
+		
 		MainCorpus ancestor = subcorpora.get(0).getMainCorpus();
 		String id1 = subcorpora.get(0).getQualifiedCqpId();
 		String id2 = subcorpora.get(1).getQualifiedCqpId();
 		String cqpid = CqpObject.subcorpusNamePrefix + CQPCorpus.getNextSubcorpusCounter();
 		String command = "inter";
 		AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-
-		//TODO: finish the command
 		
-//		String query = cqpid+"="+command+" "+id1+" "+id2+";";
-//		try {
-//			CQI.query(query)
-//		} catch (Exception e) {
-//			println "Error: "+CQI.getLastError()+". Please restart TXM."
-//			return;
-//		}
-//
-//		Subcorpus subcorpus = new Subcorpus(cqpid, name, ancestor, new Query("$command $id1 $id2;"));
-//
-//		println "$subcorpus stored in $ancestor"
-//
-//		monitor.syncExec(new Runnable() {
-//			public void run() {
-//				CorporaView.refresh();
-//				CorporaView.expand(subcorpus.getParent());
-//			}
-//		});
-
+		// TODO: finish the command
+		
+		// String query = cqpid+"="+command+" "+id1+" "+id2+";";
+		// try {
+		// CQI.query(query)
+		// } catch (Exception e) {
+		// println "Error: "+CQI.getLastError()+". Please restart TXM."
+		// return;
+		// }
+		//
+		// Subcorpus subcorpus = new Subcorpus(cqpid, name, ancestor, new Query("$command $id1 $id2;"));
+		//
+		// println "$subcorpus stored in $ancestor"
+		//
+		// monitor.syncExec(new Runnable() {
+		// public void run() {
+		// CorporaView.refresh();
+		// CorporaView.expand(subcorpus.getParent());
+		// }
+		// });
+		
 		return null;
 	}
-
+	
 	@Override
 	public boolean isEnabled() {
 		return super.isEnabled();
 	}
-
+	
 	@Override
 	public boolean isHandled() {
 		return super.isHandled();
 	}
-
+	
 	@Override
 	public void removeHandlerListener(IHandlerListener handlerListener) {
 		super.removeHandlerListener(handlerListener);
