Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs	(revision 6906)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs	(revision 6907)
@@ -50,12 +50,13 @@
       PotvinEncoding child = parent2.Clone() as PotvinEncoding;
 
-      int tourParent1 = random.Next(parent1.Tours.Count);
-      Tour replacing = parent1.Tours[tourParent1].Clone() as Tour;
+      if (parent1.Tours.Count > 0 && child.Tours.Count > 0) {
+        int tourParent1 = random.Next(parent1.Tours.Count);
+        Tour replacing = parent1.Tours[tourParent1].Clone() as Tour;
 
-      int tourParent2 = random.Next(child.Tours.Count);
-      Tour replaced = child.Tours[tourParent2];
+        int tourParent2 = random.Next(child.Tours.Count);
+        Tour replaced = child.Tours[tourParent2];
 
-      child.Tours.Remove(replaced);
-      child.Tours.Insert(tourParent2, replacing);
+        child.Tours.Remove(replaced);
+        child.Tours.Insert(tourParent2, replacing);
 
         Permutation vehicleAssignment = child.VehicleAssignment;
@@ -70,17 +71,20 @@
             break;
           }
-        }        
+        }
 
-      foreach (int city in replaced.Stops)
-        if (FindRoute(child, city) == null && !child.Unrouted.Contains(city))
-          child.Unrouted.Add(city);
+        foreach (int city in replaced.Stops)
+          if (FindRoute(child, city) == null && !child.Unrouted.Contains(city))
+            child.Unrouted.Add(city);
 
-      if (Repair(random, child, replacing, ProblemInstance, allowInfeasible) || allowInfeasible)
+        if (Repair(random, child, replacing, ProblemInstance, allowInfeasible) || allowInfeasible)
+          return child;
+        else {
+          if (random.NextDouble() < 0.5)
+            return parent1.Clone() as PotvinEncoding;
+          else
+            return parent2.Clone() as PotvinEncoding;
+        }
+      } else {
         return child;
-      else {
-        if(random.NextDouble() < 0.5)
-          return parent1.Clone() as PotvinEncoding;
-        else
-          return parent2.Clone() as PotvinEncoding;
       }
     }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs	(revision 6906)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs	(revision 6907)
@@ -53,38 +53,42 @@
       int cities = ProblemInstance.Cities.Value;
 
-      int breakPoint1 = random.Next(1, cities + 1);
-      Tour tour1 = FindRoute(child, breakPoint1);
-      breakPoint1 = tour1.Stops.IndexOf(breakPoint1);
+      if (cities > 0) {
+        int breakPoint1 = random.Next(1, cities + 1);
+        Tour tour1 = FindRoute(child, breakPoint1);
+        breakPoint1 = tour1.Stops.IndexOf(breakPoint1);
 
-      for (int i = 0; i < breakPoint1; i++)
-        newTour.Stops.Add(tour1.Stops[i]);
+        for (int i = 0; i < breakPoint1; i++)
+          newTour.Stops.Add(tour1.Stops[i]);
 
-      int breakPoint2 = random.Next(1, cities + 1);
-      Tour tour2 = FindRoute(parent2, breakPoint2);
-      breakPoint2 = tour2.Stops.IndexOf(breakPoint2);
+        int breakPoint2 = random.Next(1, cities + 1);
+        Tour tour2 = FindRoute(parent2, breakPoint2);
+        breakPoint2 = tour2.Stops.IndexOf(breakPoint2);
 
-      for (int i = breakPoint2; i < tour2.Stops.Count; i++)
-        newTour.Stops.Add(tour2.Stops[i]);
+        for (int i = breakPoint2; i < tour2.Stops.Count; i++)
+          newTour.Stops.Add(tour2.Stops[i]);
 
-      int tour1Index = child.Tours.IndexOf(tour1);
-      child.Tours.Remove(tour1);
-      child.Tours.Insert(tour1Index, newTour);
+        int tour1Index = child.Tours.IndexOf(tour1);
+        child.Tours.Remove(tour1);
+        child.Tours.Insert(tour1Index, newTour);
 
-      foreach (int city in tour1.Stops)
-        if (FindRoute(child, city) == null && !child.Unrouted.Contains(city))
-          child.Unrouted.Add(city);
+        foreach (int city in tour1.Stops)
+          if (FindRoute(child, city) == null && !child.Unrouted.Contains(city))
+            child.Unrouted.Add(city);
 
-      foreach (int city in tour2.Stops)
-        if (FindRoute(child, city) == null && !child.Unrouted.Contains(city))
-          child.Unrouted.Add(city);
+        foreach (int city in tour2.Stops)
+          if (FindRoute(child, city) == null && !child.Unrouted.Contains(city))
+            child.Unrouted.Add(city);
 
-      if (Repair(random, child, newTour, ProblemInstance, allowInfeasible) || allowInfeasible) {
+        if (Repair(random, child, newTour, ProblemInstance, allowInfeasible) || allowInfeasible) {
+          return child;
+        } else {
+          if (random.NextDouble() < 0.5)
+            return parent1.Clone() as PotvinEncoding;
+          else
+            return parent2.Clone() as PotvinEncoding;
+        }
+      } else {
         return child;
-      } else {
-        if (random.NextDouble() < 0.5)
-          return parent1.Clone() as PotvinEncoding;
-        else
-          return parent2.Clone() as PotvinEncoding;
-      }
+      } 
     }
   }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinCustomerRelocationManipulator.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinCustomerRelocationManipulator.cs	(revision 6906)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinCustomerRelocationManipulator.cs	(revision 6907)
@@ -53,184 +53,186 @@
       Tour route1;
 
-      int mode = random.Next(0,3);
-
-      //Try pickup and delivery first
-      IPickupAndDeliveryProblemInstance pdp = ProblemInstance as IPickupAndDeliveryProblemInstance;
-      if (pdp != null && mode == 0) {
-        selectedIndex = SelectRandomTourBiasedByLength(random, individual);
-        route1 =
-          individual.Tours[selectedIndex];
-
-        List<int> deliveryViolations = new List<int>();
-
-        Dictionary<int, bool> visited = new Dictionary<int, bool>();
-        for (int i = 0; i < route1.Stops.Count; i++) {
-          int stop = route1.Stops[i];
-          if (ProblemInstance.GetDemand(stop) < 0) {
-            int source = pdp.GetPickupDeliveryLocation(stop);
-
-            if (!visited.ContainsKey(source))
-              deliveryViolations.Add(stop);
-          }
-
-          visited.Add(stop, true);
-        }
-
-        if (deliveryViolations.Count > 0) {
-          int selected =
-            deliveryViolations[random.Next(deliveryViolations.Count)];
-
-          int source = pdp.GetPickupDeliveryLocation(selected);
-
-          //find route of source
-          Tour found = null;
-          foreach (Tour tour in individual.Tours) {
-            if (tour.Stops.Contains(source)) {
-              found = tour;
-              break;
-            }
-          }
-
-          if (found != null) {
-            double rand = random.NextDouble();
-            if (rand < 0.33) {
-              route1.Stops.Remove(selected);
-
-              int index = individual.FindBestInsertionPlace(found, selected);
-              found.Stops.Insert(index, selected);
-              performed = true;
-
-              if (route1.Stops.Count == 0)
-                individual.Tours.Remove(route1);
-            } else if (rand < 0.66) {
-              found.Stops.Remove(source);
-
-              int index = individual.FindBestInsertionPlace(route1, source);
-              route1.Stops.Insert(index, source);
-              performed = true;
-
-              if (found.Stops.Count == 0)
-                individual.Tours.Remove(found);
-            } else {
-              found.Stops.Remove(source);
-              route1.Stops.Remove(selected);
-
-              int chosenRoute = random.Next(individual.Tours.Count);
-              Tour tour = individual.Tours[chosenRoute];
-
-              int index = individual.FindBestInsertionPlace(tour, source);
-              tour.Stops.Insert(index, source);
-              index = individual.FindBestInsertionPlace(tour, selected);
-              tour.Stops.Insert(index, selected);
-
-              if (found.Stops.Count == 0)
-                individual.Tours.Remove(found);
-              if (route1.Stops.Count == 0)
-                individual.Tours.Remove(route1);
-            }
-          }
-        }
-      }
-
-      //then try tw
-      if (!performed && mode == 1) {
-        ITimeWindowedProblemInstance vrptw = ProblemInstance as ITimeWindowedProblemInstance;
-
-        if (vrptw != null) {
+      if (individual.Tours.Count > 0) {
+        int mode = random.Next(0, 3);
+
+        //Try pickup and delivery first
+        IPickupAndDeliveryProblemInstance pdp = ProblemInstance as IPickupAndDeliveryProblemInstance;
+        if (pdp != null && mode == 0) {
           selectedIndex = SelectRandomTourBiasedByLength(random, individual);
           route1 =
             individual.Tours[selectedIndex];
 
-          DoubleArray dueTime = vrptw.DueTime;
-          DoubleArray readyTime = vrptw.ReadyTime;
-          DoubleArray serviceTimes = vrptw.ServiceTime;
-
-          int depot = 0;
-          int depots = 1;
-
-          int tourIndex = individual.GetTourIndex(route1);
-          int vehicle = individual.GetVehicleAssignment(tourIndex);
-
-          if (ProblemInstance is IMultiDepotProblemInstance) {
-            depots = (ProblemInstance as IMultiDepotProblemInstance).Depots.Value;
-            depot = (ProblemInstance as IMultiDepotProblemInstance).VehicleDepotAssignment[vehicle];
-          }
-
-          List<int> timeWindowViolations = new List<int>();
-          double time = 0;
-
+          List<int> deliveryViolations = new List<int>();
+
+          Dictionary<int, bool> visited = new Dictionary<int, bool>();
           for (int i = 0; i < route1.Stops.Count; i++) {
-            int start = 0;
-            if (i > 0)
-              start = route1.Stops[i - 1];
-            int end = route1.Stops[i];
-
-            //drive there
-            double currentDistace = vrptw.GetDistance(start, end, individual);
-            time += currentDistace;
-
-            int endIndex = end + depots - 1;
-
-            //check if it was serviced on time
-            if (time > dueTime[endIndex]) {
-              timeWindowViolations.Add(end);
-            }
-
-            //wait
-            double currentWaitingTime = 0.0;
-            if (time < readyTime[endIndex])
-              currentWaitingTime = readyTime[endIndex] - time;
-            time += currentWaitingTime;
-
-            if (end > 0) {
-              //service
-              double currentServiceTime = serviceTimes[end - 1];
-              time += currentServiceTime;
-            }
-          }
-
-          if (timeWindowViolations.Count > 0) {
+            int stop = route1.Stops[i];
+            if (ProblemInstance.GetDemand(stop) < 0) {
+              int source = pdp.GetPickupDeliveryLocation(stop);
+
+              if (!visited.ContainsKey(source))
+                deliveryViolations.Add(stop);
+            }
+
+            visited.Add(stop, true);
+          }
+
+          if (deliveryViolations.Count > 0) {
             int selected =
-              timeWindowViolations[random.Next(timeWindowViolations.Count)];
-
-            int oldIndex = route1.Stops.IndexOf(selected);
-            route1.Stops.Remove(selected);
-
-            int route, place;
-            if (FindInsertionPlace(individual, selected, selectedIndex, allowInfeasible, out route, out place)) {
-              Tour newTour = individual.Tours[route];
-              newTour.Stops.Insert(place, selected);
-              performed = true;
-            } else {
-              route1.Stops.Insert(oldIndex, selected);
-            }
-
-            if (route1.Stops.Count == 0)
-              individual.Tours.Remove(route1);
+              deliveryViolations[random.Next(deliveryViolations.Count)];
+
+            int source = pdp.GetPickupDeliveryLocation(selected);
+
+            //find route of source
+            Tour found = null;
+            foreach (Tour tour in individual.Tours) {
+              if (tour.Stops.Contains(source)) {
+                found = tour;
+                break;
+              }
+            }
+
+            if (found != null) {
+              double rand = random.NextDouble();
+              if (rand < 0.33) {
+                route1.Stops.Remove(selected);
+
+                int index = individual.FindBestInsertionPlace(found, selected);
+                found.Stops.Insert(index, selected);
+                performed = true;
+
+                if (route1.Stops.Count == 0)
+                  individual.Tours.Remove(route1);
+              } else if (rand < 0.66) {
+                found.Stops.Remove(source);
+
+                int index = individual.FindBestInsertionPlace(route1, source);
+                route1.Stops.Insert(index, source);
+                performed = true;
+
+                if (found.Stops.Count == 0)
+                  individual.Tours.Remove(found);
+              } else {
+                found.Stops.Remove(source);
+                route1.Stops.Remove(selected);
+
+                int chosenRoute = random.Next(individual.Tours.Count);
+                Tour tour = individual.Tours[chosenRoute];
+
+                int index = individual.FindBestInsertionPlace(tour, source);
+                tour.Stops.Insert(index, source);
+                index = individual.FindBestInsertionPlace(tour, selected);
+                tour.Stops.Insert(index, selected);
+
+                if (found.Stops.Count == 0)
+                  individual.Tours.Remove(found);
+                if (route1.Stops.Count == 0)
+                  individual.Tours.Remove(route1);
+              }
+            }
           }
         }
-      }
-
-      //finally relocate random customer
-      if (!performed) {
-        selectedIndex = SelectRandomTourBiasedByLength(random, individual);
-        route1 =
-          individual.Tours[selectedIndex];
-
-        int selected = route1.Stops[random.Next(route1.Stops.Count)];
-        int oldIndex = route1.Stops.IndexOf(selected);
-        route1.Stops.Remove(selected);
-
-        int route, place;
-        if (FindInsertionPlace(individual, selected, selectedIndex, allowInfeasible, out route, out place)) {
-          Tour tour = individual.Tours[route];
-          tour.Stops.Insert(place, selected);
-          performed = true;
-        } else {
-          route1.Stops.Insert(oldIndex, selected);
+
+        //then try tw
+        if (!performed && mode == 1) {
+          ITimeWindowedProblemInstance vrptw = ProblemInstance as ITimeWindowedProblemInstance;
+
+          if (vrptw != null) {
+            selectedIndex = SelectRandomTourBiasedByLength(random, individual);
+            route1 =
+              individual.Tours[selectedIndex];
+
+            DoubleArray dueTime = vrptw.DueTime;
+            DoubleArray readyTime = vrptw.ReadyTime;
+            DoubleArray serviceTimes = vrptw.ServiceTime;
+
+            int depot = 0;
+            int depots = 1;
+
+            int tourIndex = individual.GetTourIndex(route1);
+            int vehicle = individual.GetVehicleAssignment(tourIndex);
+
+            if (ProblemInstance is IMultiDepotProblemInstance) {
+              depots = (ProblemInstance as IMultiDepotProblemInstance).Depots.Value;
+              depot = (ProblemInstance as IMultiDepotProblemInstance).VehicleDepotAssignment[vehicle];
+            }
+
+            List<int> timeWindowViolations = new List<int>();
+            double time = 0;
+
+            for (int i = 0; i < route1.Stops.Count; i++) {
+              int start = 0;
+              if (i > 0)
+                start = route1.Stops[i - 1];
+              int end = route1.Stops[i];
+
+              //drive there
+              double currentDistace = vrptw.GetDistance(start, end, individual);
+              time += currentDistace;
+
+              int endIndex = end + depots - 1;
+
+              //check if it was serviced on time
+              if (time > dueTime[endIndex]) {
+                timeWindowViolations.Add(end);
+              }
+
+              //wait
+              double currentWaitingTime = 0.0;
+              if (time < readyTime[endIndex])
+                currentWaitingTime = readyTime[endIndex] - time;
+              time += currentWaitingTime;
+
+              if (end > 0) {
+                //service
+                double currentServiceTime = serviceTimes[end - 1];
+                time += currentServiceTime;
+              }
+            }
+
+            if (timeWindowViolations.Count > 0) {
+              int selected =
+                timeWindowViolations[random.Next(timeWindowViolations.Count)];
+
+              int oldIndex = route1.Stops.IndexOf(selected);
+              route1.Stops.Remove(selected);
+
+              int route, place;
+              if (FindInsertionPlace(individual, selected, selectedIndex, allowInfeasible, out route, out place)) {
+                Tour newTour = individual.Tours[route];
+                newTour.Stops.Insert(place, selected);
+                performed = true;
+              } else {
+                route1.Stops.Insert(oldIndex, selected);
+              }
+
+              if (route1.Stops.Count == 0)
+                individual.Tours.Remove(route1);
+            }
+          }
         }
 
-        if (route1.Stops.Count == 0)
-          individual.Tours.Remove(route1);
+        //finally relocate random customer
+        if (!performed) {
+          selectedIndex = SelectRandomTourBiasedByLength(random, individual);
+          route1 =
+            individual.Tours[selectedIndex];
+
+          int selected = route1.Stops[random.Next(route1.Stops.Count)];
+          int oldIndex = route1.Stops.IndexOf(selected);
+          route1.Stops.Remove(selected);
+
+          int route, place;
+          if (FindInsertionPlace(individual, selected, selectedIndex, allowInfeasible, out route, out place)) {
+            Tour tour = individual.Tours[route];
+            tour.Stops.Insert(place, selected);
+            performed = true;
+          } else {
+            route1.Stops.Insert(oldIndex, selected);
+          }
+
+          if (route1.Stops.Count == 0)
+            individual.Tours.Remove(route1);
+        }
       }
     }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs	(revision 6906)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs	(revision 6907)
@@ -49,25 +49,26 @@
       
       int selectedIndex = SelectRandomTourBiasedByLength(random, individual);
-      Tour route1 =
-        individual.Tours[selectedIndex];
+      if (selectedIndex >= 0) {
+        Tour route1 =
+          individual.Tours[selectedIndex];
 
-      int count = route1.Stops.Count;
-      int i = 0;
-      while(i < count) {
-        int insertedRoute, insertedPlace;
+        int count = route1.Stops.Count;
+        int i = 0;
+        while (i < count) {
+          int insertedRoute, insertedPlace;
 
-        int city = route1.Stops[i];
-        route1.Stops.Remove(city);
+          int city = route1.Stops[i];
+          route1.Stops.Remove(city);
 
-        if (FindInsertionPlace(individual, city, selectedIndex, allowInfeasible, out insertedRoute, out insertedPlace)) {
-          individual.Tours[insertedRoute].Stops.Insert(insertedPlace, city);
-        } else {
-          route1.Stops.Insert(i, city);
-          i++;
+          if (FindInsertionPlace(individual, city, selectedIndex, allowInfeasible, out insertedRoute, out insertedPlace)) {
+            individual.Tours[insertedRoute].Stops.Insert(insertedPlace, city);
+          } else {
+            route1.Stops.Insert(i, city);
+            i++;
+          }
+
+          count = route1.Stops.Count;
         }
-
-        count = route1.Stops.Count;
       }
-
     }
   }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs	(revision 6906)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs	(revision 6907)
@@ -49,47 +49,49 @@
       
       int selectedIndex = SelectRandomTourBiasedByLength(random, individual);
-      Tour route1 = individual.Tours[selectedIndex];
+      if (selectedIndex >= 0) {
+        Tour route1 = individual.Tours[selectedIndex];
 
-      bool performed = false;
-      int customer1Position = 0;
-      while (customer1Position < route1.Stops.Count) {
-        performed = false;
+        bool performed = false;
+        int customer1Position = 0;
+        while (customer1Position < route1.Stops.Count) {
+          performed = false;
 
-        foreach (Tour tour in individual.Tours) {
-          if (tour != route1) {
-            for (int customer2Position = 0; customer2Position < tour.Stops.Count; customer2Position++) {
-              int customer1 = route1.Stops[customer1Position];
-              int customer2 = tour.Stops[customer2Position];
+          foreach (Tour tour in individual.Tours) {
+            if (tour != route1) {
+              for (int customer2Position = 0; customer2Position < tour.Stops.Count; customer2Position++) {
+                int customer1 = route1.Stops[customer1Position];
+                int customer2 = tour.Stops[customer2Position];
 
-              //customer1 can be feasibly inserted at the location of customer2
-              tour.Stops[customer2Position] = customer1;
-              route1.Stops.RemoveAt(customer1Position);
+                //customer1 can be feasibly inserted at the location of customer2
+                tour.Stops[customer2Position] = customer1;
+                route1.Stops.RemoveAt(customer1Position);
 
-              if (ProblemInstance.TourFeasible(tour, individual)) {
-                int routeIdx, place;
-                if (FindInsertionPlace(individual,
-                  customer2, selectedIndex, allowInfeasible, out routeIdx, out place)) {
-                  individual.Tours[routeIdx].Stops.Insert(place, customer2);
+                if (ProblemInstance.TourFeasible(tour, individual)) {
+                  int routeIdx, place;
+                  if (FindInsertionPlace(individual,
+                    customer2, selectedIndex, allowInfeasible, out routeIdx, out place)) {
+                    individual.Tours[routeIdx].Stops.Insert(place, customer2);
 
-                  //two-level exchange has been performed
-                  performed = true;
-                  break;
+                    //two-level exchange has been performed
+                    performed = true;
+                    break;
+                  } else {
+                    tour.Stops[customer2Position] = customer2;
+                    route1.Stops.Insert(customer1Position, customer1);
+                  }
                 } else {
                   tour.Stops[customer2Position] = customer2;
                   route1.Stops.Insert(customer1Position, customer1);
                 }
-              } else {
-                tour.Stops[customer2Position] = customer2;
-                route1.Stops.Insert(customer1Position, customer1);
               }
             }
+
+            if (performed)
+              break;
           }
 
-          if (performed)
-            break;
+          if (!performed)
+            customer1Position++;
         }
-
-        if (!performed)
-          customer1Position++;
       }
     }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs	(revision 6906)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs	(revision 6907)
@@ -61,4 +61,32 @@
         this.Unrouted = new List<int>(original.Unrouted);
         this.VehicleAssignment = cloner.Clone<Permutation>(original.VehicleAssignment);
+    }
+
+    public override void Repair() {
+      List<Tour> toBeRemoved = new List<Tour>();
+      foreach (Tour tour in Tours) {
+        if (tour.Stops.Count == 0)
+          toBeRemoved.Add(tour);
+      }
+
+      foreach (Tour tour in toBeRemoved) {
+        int index = Tours.IndexOf(tour);
+        if (index < VehicleAssignment.Length) {
+          int vehicle = VehicleAssignment[index];
+
+          Tours.Remove(tour);
+          for (int i = index; i < VehicleAssignment.Length - 1; i++) {
+            VehicleAssignment[i] = VehicleAssignment[i + 1];
+          }
+          VehicleAssignment[VehicleAssignment.Length - 1] = vehicle;
+        }
+      }
+
+      while (Tours.Count > ProblemInstance.Vehicles.Value) {
+        Tour tour = Tours[Tours.Count - 1];
+        Tours[Tours.Count - 2].Stops.AddRange(tour.Stops);
+
+        Tours.Remove(tour);
+      }
     }
 
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs	(revision 6906)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs	(revision 6907)
@@ -207,4 +207,17 @@
       OnOperatorsChanged();
     }
+
+    public void SetProblemInstance(IVRPProblemInstance instance) {
+      ProblemInstanceParameter.ValueChanged -= new EventHandler(ProblemInstanceParameter_ValueChanged);
+
+      ProblemInstance = instance;
+      AttachProblemInstanceEventHandlers();
+
+      OnSolutionCreatorChanged();
+      OnEvaluatorChanged();
+
+      ProblemInstanceParameter.ValueChanged += new EventHandler(ProblemInstanceParameter_ValueChanged);
+    }
+
     private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
       ParameterizeSolutionCreator();
