Index: applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/AssociatedStreetFixer.java
===================================================================
--- applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/AssociatedStreetFixer.java	(revision 36102)
+++ applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/AssociatedStreetFixer.java	(revision 36103)
@@ -12,4 +12,5 @@
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.SequenceCommand;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -18,4 +19,5 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.tools.Utils;
 
 public class AssociatedStreetFixer extends RelationFixer {
@@ -135,5 +137,6 @@
         List<Command> commandList = new ArrayList<>();
         if (fixed) {
-            commandList.add(new ChangeCommand(MainApplication.getLayerManager().getEditDataSet(), source, rel));
+            final DataSet ds = Utils.firstNonNull(source.getDataSet(), MainApplication.getLayerManager().getEditDataSet());
+            commandList.add(new ChangeCommand(ds, source, rel));
         }
 
Index: applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/BoundaryFixer.java
===================================================================
--- applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/BoundaryFixer.java	(revision 36102)
+++ applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/BoundaryFixer.java	(revision 36103)
@@ -6,4 +6,5 @@
 import org.openstreetmap.josm.command.ChangeCommand;
 import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -11,4 +12,5 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -66,5 +68,9 @@
             r = rr;
         }
-        return fixed ? new ChangeCommand(MainApplication.getLayerManager().getEditDataSet(), rel, r) : null;
+        if (fixed) {
+            final DataSet ds = Utils.firstNonNull(rel.getDataSet(), MainApplication.getLayerManager().getEditDataSet());
+            return new ChangeCommand(ds, rel, r);
+        }
+        return null;
     }
 
Index: applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/MultipolygonFixer.java
===================================================================
--- applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/MultipolygonFixer.java	(revision 36102)
+++ applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/MultipolygonFixer.java	(revision 36103)
@@ -11,6 +11,6 @@
 import org.openstreetmap.josm.command.ChangeCommand;
 import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.MultipolygonBuilder;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.Relation;
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -47,5 +48,9 @@
     public Command fixRelation(Relation rel) {
         Relation rr = fixMultipolygonRoles(rel);
-        return rr != null ? new ChangeCommand(MainApplication.getLayerManager().getEditDataSet(), rel, rr) : null;
+        if (rr != null) {
+            final DataSet ds = Utils.firstNonNull(rel.getDataSet(), MainApplication.getLayerManager().getEditDataSet());
+            return new ChangeCommand(ds, rel, rr);
+        }
+        return null;
     }
 
@@ -54,10 +59,5 @@
      */
     protected Relation fixMultipolygonRoles(Relation source) {
-        Collection<Way> ways = new ArrayList<>();
-        for (OsmPrimitive p : source.getMemberPrimitives()) {
-            if (p instanceof Way) {
-                ways.add((Way) p);
-            }
-        }
+        Collection<Way> ways = new ArrayList<>(source.getMemberPrimitives(Way.class));
         MultipolygonBuilder mpc = new MultipolygonBuilder();
         String error = mpc.makeFromWays(ways);
Index: applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/PublicTransportFixer.java
===================================================================
--- applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/PublicTransportFixer.java	(revision 36102)
+++ applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/PublicTransportFixer.java	(revision 36103)
@@ -6,4 +6,5 @@
 import org.openstreetmap.josm.command.ChangeCommand;
 import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.Relation;
@@ -11,4 +12,5 @@
 import org.openstreetmap.josm.gui.MainApplication;
 
+import org.openstreetmap.josm.tools.Utils;
 import relcontext.actions.PublicTransportHelper;
 
@@ -61,5 +63,9 @@
             r = rr;
         }
-        return fixed ? new ChangeCommand(MainApplication.getLayerManager().getEditDataSet(), rel, r) : null;
+        if (fixed) {
+            final DataSet ds = Utils.firstNonNull(rel.getDataSet(), MainApplication.getLayerManager().getEditDataSet());
+            return new ChangeCommand(ds, rel, r);
+        }
+        return null;
     }
 
