diff --git a/lib/OpenLayers/Control.js b/lib/OpenLayers/Control.js
index 6ccd490c37..d55be78bc7 100644
--- a/lib/OpenLayers/Control.js
+++ b/lib/OpenLayers/Control.js
@@ -52,7 +52,7 @@ OpenLayers.Control.prototype = {
// We do this before the extend so that instances can override
// className in options.
this.displayClass =
- this.CLASS_NAME.replace("OpenLayers.", "ol").replace(".","");
+ this.CLASS_NAME.replace("OpenLayers.", "ol").replace(/\./g, "");
OpenLayers.Util.extend(this, options);
diff --git a/tests/Control/test_KeyboardDefaults.html b/tests/Control/test_KeyboardDefaults.html
index c8cb53c5c8..7c44ff4b2d 100644
--- a/tests/Control/test_KeyboardDefaults.html
+++ b/tests/Control/test_KeyboardDefaults.html
@@ -4,11 +4,12 @@