Index: trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java	(revision 2441)
+++ trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java	(revision 2442)
@@ -281,8 +281,4 @@
                         + this.bbox.width()+", "+this.bbox.height()+")");
             }
-            if (children != null) {
-                abort("overwrote children");
-            }
-            children = newChildren();
             // deferring allocation of children until use
             // seems a bit faster
@@ -298,4 +294,6 @@
                     continue;
                 }
+                if (children == null)
+                    children = newChildren();
                 if (children[new_index] == null) {
                     children[new_index] = new QBLevel(this, new_index);
@@ -357,4 +355,6 @@
         boolean matches(T o, BBox search_bbox)
         {
+            // This can be optimized when o is a node
+            //return search_bbox.bounds(coor));
             return o.getBBox().intersects(search_bbox);
         }
@@ -490,5 +490,5 @@
                 }
                 if (child == null) {
-                    abort("branch node had no children");
+                    abort("branch node ("+this+" "+next.isLeaf()+") had no children (content: "+next.content+") this: " + this);
                 }
                 next = child;
@@ -568,5 +568,10 @@
                     debug = true;
                     get_index(n, level);
-                    abort("object " + n + " does not belong in node at level: " + level + " bbox: " + this.bbox());
+                    get_index(n, level-1);
+                    int nr = 0;
+                    for (QBLevel sibling : parent.children) {
+                        out("sibling["+ (nr++) +"]: " + sibling.bbox() + " this: " + (this==sibling));
+                    }
+                    abort("\nobject " + n + " does not belong in node at level: " + level + " bbox: " + this.bbox());
                 }
             }
