Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java	(revision 2868)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java	(revision 2869)
@@ -110,7 +110,7 @@
 
 		// System.out.println("selected "+concordanceEditor.getSelectedReferences());
 		// System.out.println("before avail"+availableReferenceItems);
-		availableReferenceItems.remove(concordanceEditor.getSelectedSortReferences());
+		availableReferenceItems.removeAll(concordanceEditor.getSelectedSortReferences());
 
 		// System.out.println("after avail"+availableReferenceItems);
 		DefineReferencePatternDialog d = null;
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java	(revision 2868)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java	(revision 2869)
@@ -109,7 +109,7 @@
 
 		// System.out.println("selected "+concordanceEditor.getSelectedReferences());
 		// System.out.println("before avail"+availableReferenceItems);
-		availableReferenceItems.remove(concordanceEditor.getSelectedViewReferences());
+		availableReferenceItems.removeAll(concordanceEditor.getSelectedViewReferences());
 
 		// System.out.println("after avail"+availableReferenceItems);
 		DefineReferencePatternDialog d = null;
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/widgets/ComplexSortSelector.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/widgets/ComplexSortSelector.java	(revision 2868)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/widgets/ComplexSortSelector.java	(revision 2869)
@@ -198,25 +198,25 @@
 				defaultComparator = (CompositeComparator) c;
 				List<LineComparator> comp = defaultComparator.getComparators();
 				if (comp.size() >= 4) {
-					firstKey.select(comparatorsNames.indexOf(comp.get(0)));
-					secondKey.select(comparatorsNames.indexOf(comp.get(1)));
-					thirdKey.select(comparatorsNames.indexOf(comp.get(2)));
-					fourthKey.select(comparatorsNames.indexOf(comp.get(3)));
+					firstKey.select(comparatorsNames.indexOf(comp.get(0).getName()));
+					secondKey.select(comparatorsNames.indexOf(comp.get(1).getName()));
+					thirdKey.select(comparatorsNames.indexOf(comp.get(2).getName()));
+					fourthKey.select(comparatorsNames.indexOf(comp.get(3).getName()));
 				} else if (comp.size() >= 3) {
-					firstKey.select(comparatorsNames.indexOf(comp.get(0)));
-					secondKey.select(comparatorsNames.indexOf(comp.get(1)));
-					thirdKey.select(comparatorsNames.indexOf(comp.get(2)));
-					fourthKey.select(comparatorsNames.indexOf(comp.get(2)));
+					firstKey.select(comparatorsNames.indexOf(comp.get(0).getName()));
+					secondKey.select(comparatorsNames.indexOf(comp.get(1).getName()));
+					thirdKey.select(comparatorsNames.indexOf(comp.get(2).getName()));
+					fourthKey.select(comparatorsNames.indexOf(comp.get(2).getName()));
 				} else if (comp.size() == 2) {
-					firstKey.select(comparatorsNames.indexOf(comp.get(0)));
-					secondKey.select(comparatorsNames.indexOf(comp.get(1)));
-					thirdKey.select(comparatorsNames.indexOf(comp.get(1)));
-					fourthKey.select(comparatorsNames.indexOf(comp.get(1)));
+					firstKey.select(comparatorsNames.indexOf(comp.get(0).getName()));
+					secondKey.select(comparatorsNames.indexOf(comp.get(1).getName()));
+					thirdKey.select(comparatorsNames.indexOf(comp.get(1).getName()));
+					fourthKey.select(comparatorsNames.indexOf(comp.get(1).getName()));
 				} else if (comp.size() == 1) {
-					firstKey.select(comparatorsNames.indexOf(comp.get(0)));
-					secondKey.select(comparatorsNames.indexOf(comp.get(0)));
-					thirdKey.select(comparatorsNames.indexOf(comp.get(0)));
-					fourthKey.select(comparatorsNames.indexOf(comp.get(0)));
+					firstKey.select(comparatorsNames.indexOf(comp.get(0).getName()));
+					secondKey.select(comparatorsNames.indexOf(comp.get(0).getName()));
+					thirdKey.select(comparatorsNames.indexOf(comp.get(0).getName()));
+					fourthKey.select(comparatorsNames.indexOf(comp.get(0).getName()));
 				}
 				return;
 			}
