diff --git a/src/mapgen.ts b/src/mapgen.ts
index abaed29..9ac1dfb 100644
--- a/src/mapgen.ts
+++ b/src/mapgen.ts
@@ -110,14 +110,17 @@ class Knife {
               } else {
                 errors.push(`${loc} is region ${r}, not found in merged`)
               }
+              if (r < 0) {
+                return "!";
+              }
               // 0...9 and lowercase
               if (r < 36) {
-                return r.toString(36)
+                return r.toString(36);
               }
               // uppercase
               r -= 26;
               if (r < 36) {
-                return r.toString(36).toUpperCase()
+                return r.toString(36).toUpperCase();
               }
               // Greek lowercase
               r -= 36;
@@ -134,12 +137,12 @@ class Knife {
                 return String.fromCodePoint(r + 0x3a3);
               }
               // Hebrew
-              r -= 7
+              r -= 7;
               if (r < 27) {
                 return String.fromCodePoint(r+0x5d0);
               }
               // give up
-              return "?"
+              return "?";
             }
             return ".";  // room without region
           })();