                         loc)))))
 
 (defn fix-socket-binding-group [loc]
-  (let [name (get-in (zip/node loc) [:attrs :name])]
-    (cond
-     (= "standard-sockets" name) (zip/remove loc)
-     (= "full-ha-sockets" name) (zip/edit loc assoc-in [:attrs :name] "standard-sockets")
-     :else loc)))
+  (if (looking-at? :socket-binding-groups (zip/up loc))
+    (let [name (get-in (zip/node loc) [:attrs :name])]
+      (cond
+       (= "standard-sockets" name) (zip/remove loc)
+       (= "full-ha-sockets" name) (zip/edit loc assoc-in [:attrs :name] "standard-sockets")
+       :else loc))
+    loc))
 
 (defn server-element [name offset]
   {:tag :server

  (def polyglot-modules
    ["hasingleton"]))


(defn install-module [module-dir]
  (let [name (second (re-find #"immutant-(.*)-module" (.getName module-dir)))

  [loc]
  (zip/append-child (zip/down loc) {:tag :consumer-window-size :content ["1"]}))

(defn append-system-properties [loc]
  (if (looking-at? :system-properties (zip/right loc))
    loc
    (zip/insert-right loc {:tag :system-properties})))

(defn fix-extensions [loc]
  (add-extensions (append-system-properties loc)))

(defn prepare-zip
  [file]
