Index: /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/SplitRoundaboutAction.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/SplitRoundaboutAction.java	(revision 33414)
+++ /applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/SplitRoundaboutAction.java	(revision 33415)
@@ -24,4 +24,7 @@
 import org.openstreetmap.josm.actions.SplitWayAction.SplitWayResult;
 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
+import org.openstreetmap.josm.command.ChangeCommand;
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.command.SequenceCommand;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.osm.BBox;
@@ -47,5 +50,5 @@
 public class SplitRoundaboutAction extends JosmAction {
 
-    private static final String actionName = "Split Roundabout";
+    private static final String ACTION_NAME = "Split Roundabout";
     private static final long serialVersionUID = 8912249304286025356L;
 
@@ -54,5 +57,5 @@
      */
     public SplitRoundaboutAction() {
-        super(actionName, "icons/splitroundabout", actionName, null, true);
+        super(ACTION_NAME, "icons/splitroundabout", ACTION_NAME, null, true);
     }
 
@@ -99,27 +102,51 @@
         Map<Relation, List<Integer>> savedPositions = getSavedPositions(roundabout);
 
+        //remove the roundabout from each relation
+        Main.main.undoRedo.add(getRemoveRoundaboutFromRelationsCommand(roundabout));
+
         //split the roundabout on the designed nodes
         List<Node> splitNodes = getSplitNodes(roundabout);
         SplitWayResult result = SplitWayAction.split(getLayerManager().getEditLayer(),
         		roundabout, splitNodes, Collections.emptyList());
-        result.getCommand().executeCommand();
+        Main.main.undoRedo.add(result.getCommand());
         Collection<Way> splitWays = result.getNewWays();
         splitWays.add(result.getOriginalWay());
 
         //update the relations.
-        updateRelations(savedPositions, splitNodes, splitWays);
-    }
-
-    public void updateRelations(Map<Relation, List<Integer>> savedPositions,
+        Main.main.undoRedo.add(getUpdateRelationsCommand(savedPositions, splitNodes, splitWays));
+    }
+
+    public Command getUpdateRelationsCommand(Map<Relation,
+            List<Integer>> savedPositions,
             List<Node> splitNodes, Collection<Way> splitWays) {
+
+        Map<Relation, Relation> changingRelations =
+                updateRelations(savedPositions, splitNodes, splitWays);
+
+        List<Command> commands = new ArrayList<>();
+        changingRelations.forEach((oldR, newR) ->
+            commands.add(new ChangeCommand(oldR, newR)));
+
+        return new SequenceCommand("Updating Relations for SplitRoundabout", commands);
+    }
+
+    private Map<Relation, Relation> updateRelations(Map<Relation,
+            List<Integer>> savedPositions,
+            List<Node> splitNodes, Collection<Way> splitWays) {
+        Map<Relation, Relation> changingRelation = new HashMap<>();
         Map<Relation, Integer> memberOffset = new HashMap<>();
         savedPositions.forEach((r, positions) ->
             positions.forEach(i -> {
 
+                if(!changingRelation.containsKey(r))
+                    changingRelation.put(r, new Relation(r));
+
+                Relation c = changingRelation.get(r);
+
                 if(!memberOffset.containsKey(r))
                     memberOffset.put(r, 0);
                 int offset = memberOffset.get(r);
 
-                Pair<Way, Way> entryExitWays= getEntryExitWays(r, i + offset);
+                Pair<Way, Way> entryExitWays= getEntryExitWays(c, i + offset);
                 Way entryWay = entryExitWays.a;
                 Way exitWay = entryExitWays.b;
@@ -141,5 +168,5 @@
 
                 while(!curr.lastNode().equals(exitNode)) {
-                    r.addMember(i + offset++, new RelationMember(null, curr));
+                    c.addMember(i + offset++, new RelationMember(null, curr));
                     parents = curr.lastNode().getParentWays();
                     parents.remove(curr);
@@ -147,7 +174,8 @@
                     curr = parents.get(0);
                 }
-                r.addMember(i + offset++, new RelationMember(null, curr));
+                c.addMember(i + offset++, new RelationMember(null, curr));
                 memberOffset.put(r, offset);
             }));
+        return changingRelation;
     }
 
@@ -184,7 +212,7 @@
             parents.remove(roundabout);
             for(Way parent: parents) {
-                for(OsmPrimitive prim : parent.getReferrers()) {
-                    if(prim.getType() == OsmPrimitiveType.RELATION &&
-                            RouteUtils.isPTRoute((Relation) prim))
+                for(Relation r : OsmPrimitive.getFilteredList(
+                        parent.getReferrers(), Relation.class)) {
+                    if(RouteUtils.isPTRoute(r))
                         return false;
                 }
@@ -196,4 +224,19 @@
     }
 
+    public Command getRemoveRoundaboutFromRelationsCommand(Way roundabout) {
+        List <Relation> referrers = OsmPrimitive.getFilteredList(
+                roundabout.getReferrers(), Relation.class);
+        referrers.removeIf(r -> !RouteUtils.isPTRoute(r));
+
+        List<Command> commands = new ArrayList<>();
+        referrers.forEach(r -> {
+            Relation c = new Relation(r);
+            c.removeMembersFor(roundabout);
+            commands.add(new ChangeCommand(r, c));
+        });
+
+        return new SequenceCommand("Remove roundabout from relations", commands);
+    }
+
     //save the position of the roundabout inside each public transport route
     //it is contained in
@@ -201,10 +244,9 @@
 
         Map<Relation, List<Integer>> savedPositions = new HashMap<>();
-        List <OsmPrimitive> referrers = roundabout.getReferrers();
-        referrers.removeIf(r -> r.getType() != OsmPrimitiveType.RELATION
-                || !RouteUtils.isPTRoute((Relation) r));
-
-        for(OsmPrimitive currPrim : referrers) {
-            Relation curr = (Relation) currPrim;
+        List <Relation> referrers = OsmPrimitive.getFilteredList(
+                roundabout.getReferrers(), Relation.class);
+        referrers.removeIf(r -> !RouteUtils.isPTRoute(r));
+
+        for(Relation curr : referrers) {
             for(int j = 0; j < curr.getMembersCount(); j++) {
                 if(curr.getMember(j).getUniqueId() == roundabout.getUniqueId()) {
@@ -215,7 +257,4 @@
                 }
             }
-
-            if(savedPositions.containsKey(curr))
-                curr.removeMembersFor(roundabout);
         }
 
Index: /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/actions/SplitRoundaboutTest.java
===================================================================
--- /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/actions/SplitRoundaboutTest.java	(revision 33414)
+++ /applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/actions/SplitRoundaboutTest.java	(revision 33415)
@@ -59,4 +59,5 @@
     private Collection<Way> splitWay(Way w) {
         Map<Relation, List<Integer>> savedPositions = action.getSavedPositions(w);
+        action.getRemoveRoundaboutFromRelationsCommand(w).executeCommand();
         List<Node> splitNodes = action.getSplitNodes(w);
         SplitWayResult result = SplitWayAction.split(layer, w, splitNodes, Collections.emptyList());
@@ -64,5 +65,5 @@
         Collection<Way> splitWays = result.getNewWays();
         splitWays.add(result.getOriginalWay());
-        action.updateRelations(savedPositions, splitNodes, splitWays);
+        action.getUpdateRelationsCommand(savedPositions, splitNodes, splitWays).executeCommand();
         return splitWays;
     }
@@ -74,11 +75,11 @@
         sw1.forEach(w -> {
             if (w.firstNode().getUniqueId() == 267843779L && w.lastNode().getUniqueId() == 2968718407L)
-                assertEquals(w.getReferrers().size(), 5);
+                assertEquals(5, w.getReferrers().size());
             else if (w.firstNode().getUniqueId() == 2968718407L && w.lastNode().getUniqueId() == 2383688231L)
-                assertEquals(w.getReferrers().size(), 0);
+                assertEquals(0, w.getReferrers().size());
             else if (w.firstNode().getUniqueId() == 2383688231L && w.lastNode().getUniqueId() == 267843741L)
-                assertEquals(w.getReferrers().size(), 5);
+                assertEquals(5, w.getReferrers().size());
             else if (w.firstNode().getUniqueId() == 267843741L && w.lastNode().getUniqueId() == 267843779L)
-                assertEquals(w.getReferrers().size(), 0);
+                assertEquals(0, w.getReferrers().size());
             else
                 fail();
@@ -92,11 +93,11 @@
         sw2.forEach(w -> {
             if(w.firstNode().getUniqueId() == 2158181809L && w.lastNode().getUniqueId() == 2158181798L)
-                assertEquals(w.getReferrers().size(), 8);
+                assertEquals(8, w.getReferrers().size());
             else if (w.firstNode().getUniqueId() == 2158181798L && w.lastNode().getUniqueId() == 2158181789L)
-                assertEquals(w.getReferrers().size(), 0);
+                assertEquals(0, w.getReferrers().size());
             else if (w.firstNode().getUniqueId() == 2158181789L && w.lastNode().getUniqueId() == 2158181803L)
-                assertEquals(w.getReferrers().size(), 8);
+                assertEquals(8, w.getReferrers().size());
             else if (w.firstNode().getUniqueId() == 2158181803L && w.lastNode().getUniqueId() == 2158181809L)
-                assertEquals(w.getReferrers().size(), 0);
+                assertEquals(0, w.getReferrers().size());
             else
                 fail();
@@ -110,11 +111,11 @@
         sw3.forEach(w -> {
             if(w.firstNode().getUniqueId() == 280697532L && w.lastNode().getUniqueId() == 280697452L)
-                assertEquals(w.getReferrers().size(), 0);
+                assertEquals(0, w.getReferrers().size());
             else if (w.firstNode().getUniqueId() == 280697452L && w.lastNode().getUniqueId() == 280697591L)
-                assertEquals(w.getReferrers().size(), 2);
+                assertEquals(2, w.getReferrers().size());
             else if (w.firstNode().getUniqueId() == 280697591L && w.lastNode().getUniqueId() == 280697534L)
-                assertEquals(w.getReferrers().size(), 0);
+                assertEquals(0, w.getReferrers().size());
             else if (w.firstNode().getUniqueId() == 280697534L && w.lastNode().getUniqueId() == 280697532L)
-                assertEquals(w.getReferrers().size(), 1);
+                assertEquals(1, w.getReferrers().size());
             else
                 fail();
