Index: /trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java	(revision 13636)
+++ /trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java	(revision 13637)
@@ -21,8 +21,8 @@
 
 /**
-* Abstract class to represent common features of the datatypes primitives.
-*
-* @since 4099
-*/
+ * Abstract class to represent common features of the datatypes primitives.
+ *
+ * @since 4099
+ */
 public abstract class AbstractPrimitive implements IPrimitive {
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java	(revision 13636)
+++ /trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java	(revision 13637)
@@ -147,6 +147,7 @@
      * @return the value of "layer" key, or null if absent or set to 0 (default value)
      * @since 12986
+     * @since 13637 (signature)
      */
-    public static String getLayer(OsmPrimitive w) {
+    public static String getLayer(IPrimitive w) {
         String layer1 = w.get("layer");
         if ("0".equals(layer1)) {
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 13636)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 13637)
@@ -280,5 +280,5 @@
 
         // Fix relations.
-        if (relationWithRelations != null && relationToKeep != relationWithRelations) {
+        if (relationWithRelations != null && relRef != null && relationToKeep != relationWithRelations) {
             for (Relation rel : relRef) {
                 Relation newRel = new Relation(rel);
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java	(revision 13636)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java	(revision 13637)
@@ -339,6 +339,7 @@
     @Override
     public Command fixError(TestError testError) {
-        if (isFixable(testError) && !testError.getPrimitives().iterator().next().isDeleted()) {
-            return new DeleteCommand(testError.getPrimitives());
+        Collection<? extends OsmPrimitive> primitives = testError.getPrimitives();
+        if (isFixable(testError) && !primitives.iterator().next().isDeleted()) {
+            return new DeleteCommand(primitives);
         }
         return null;
