Index: lib/OpenLayers/Control/Panel.js
===================================================================
--- lib/OpenLayers/Control/Panel.js	(revision 6324)
+++ lib/OpenLayers/Control/Panel.js	(working copy)
@@ -148,14 +148,11 @@
             return;
         }
         for (var i = 0; i < this.controls.length; i++) {
-            if (this.controls[i] == control) {
-                control.activate();
-            } else {
-                if (this.controls[i].type != OpenLayers.Control.TYPE_TOGGLE) {
-                    this.controls[i].deactivate();
-                }
+            if (this.controls[i] != control && this.controls[i].type != OpenLayers.Control.TYPE_TOGGLE) {
+                this.controls[i].deactivate();
             }
         }
+        control.activate();
     },
 
     /**
Index: lib/OpenLayers/Control/ZoomBox.js
===================================================================
--- lib/OpenLayers/Control/ZoomBox.js	(revision 6324)
+++ lib/OpenLayers/Control/ZoomBox.js	(working copy)
@@ -54,7 +54,7 @@
                 var pixHeight = Math.abs(position.top-position.bottom);
                 var zoomFactor = Math.min((this.map.size.h / pixHeight),
                     (this.map.size.w / pixWidth));
-                var extent = map.getExtent();
+                var extent = this.map.getExtent();
                 var center = this.map.getLonLatFromPixel(
                     position.getCenterPixel());
                 var xmin = center.lon - (extent.getWidth()/2)*zoomFactor;
