Index: trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java	(revision 3152)
+++ trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java	(revision 3153)
@@ -30,9 +30,4 @@
      */
     static public class LayerListCellRenderer extends DefaultListCellRenderer {
-
-        protected boolean isActiveLayer(Layer layer) {
-            if (Main.isDisplayingMapView()) return false;
-            return Main.map.mapView.getActiveLayer() == layer;
-        }
 
         @Override
Index: trunk/src/org/openstreetmap/josm/data/osm/BBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 3152)
+++ trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 3153)
@@ -22,4 +22,11 @@
         add(a);
         add(b);
+    }
+
+    public BBox(BBox copy) {
+        this.xmin = copy.xmin;
+        this.xmax = copy.xmax;
+        this.ymin = copy.ymin;
+        this.ymax = copy.ymax;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/Relation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 3152)
+++ trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 3153)
@@ -334,4 +334,6 @@
     @Override
     public BBox getBBox() {
+        if (members.isEmpty())
+            return new BBox(0, 0, 0, 0);
         if (getDataSet() == null)
             return calculateBBox(new HashSet<PrimitiveId>());
@@ -339,9 +341,6 @@
             if (bbox == null) {
                 bbox = calculateBBox(new HashSet<PrimitiveId>());
-                if (bbox == null) {
-                    bbox = new BBox(0, 0, 0, 0); // No members
-                }
-            }
-            return  bbox;
+            }
+            return new BBox(bbox);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/osm/Way.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 3152)
+++ trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 3153)
@@ -401,5 +401,5 @@
             bbox = new BBox(this);
         }
-        return bbox;
+        return new BBox(bbox);
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 3153)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 3153)
@@ -0,0 +1,39 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.projection.Mercator;
+import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
+import org.openstreetmap.josm.io.OsmReader;
+
+public class QuadBucketsTest {
+
+    @Test
+    public void testRemove() throws Exception {
+        Main.proj = new Mercator();
+        DataSet ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/restriction.osm"), NullProgressMonitor.INSTANCE);
+        List<Node> allNodes = new ArrayList<Node>(ds.getNodes());
+        List<Way> allWays = new ArrayList<Way>(ds.getWays());
+        List<Relation> allRelations = new ArrayList<Relation>(ds.getRelations());
+        for (OsmPrimitive o: allNodes) {
+            ds.removePrimitive(o);
+        }
+        for (OsmPrimitive o: allWays) {
+            ds.removePrimitive(o);
+        }
+        for (OsmPrimitive o: allRelations) {
+            ds.removePrimitive(o);
+        }
+
+        Assert.assertTrue(ds.getNodes().isEmpty());
+        Assert.assertTrue(ds.getWays().isEmpty());
+        Assert.assertTrue(ds.getRelations().isEmpty());
+    }
+
+}
