.
diff --git a/emscripten.py b/emscripten.py
index baa836c..dd94f48 100644
--- a/emscripten.py
+++ b/emscripten.py
@@ -119,12 +119,13 @@
   all_exports = metadata['exports'] + list(metadata['namedGlobals'].keys())
   settings.WASM_EXPORTS = [asmjs_mangle(x) for x in all_exports]
 
-  # start with the MVP features, and add any detected features.
-  settings.BINARYEN_FEATURES = ['--mvp-features'] + metadata['features']
-  if settings.USE_PTHREADS:
-    assert '--enable-threads' in settings.BINARYEN_FEATURES
-  if settings.MEMORY64:
-    assert '--enable-memory64' in settings.BINARYEN_FEATURES
+  if 'features' in metadata:
+    # start with the MVP features, and add any detected features.
+    settings.BINARYEN_FEATURES = ['--mvp-features'] + metadata['features']
+    if settings.USE_PTHREADS:
+      assert '--enable-threads' in settings.BINARYEN_FEATURES
+    if settings.MEMORY64:
+      assert '--enable-memory64' in settings.BINARYEN_FEATURES
 
   if settings.RELOCATABLE and settings.INITIAL_TABLE == -1:
     # When building relocatable output (e.g. MAIN_MODULE) the reported table
@@ -385,6 +386,7 @@
   imports = module.imports()
   exports = module.exports()
   globals_ = module.globals()
+  num_global_imports = len([i for i in imports if i.kind == webassembly.ExternType.GLOBAL])
 
   metadata = {
     'exports': [],
@@ -399,9 +401,11 @@
 
   for export in exports:
     if export.name == '__start_em_asm':
-      em_asm_start = globals_[export.index]
+      assert export.index > num_global_imports
+      em_asm_start = globals_[export.index - num_global_imports]
     elif export.name == '__stop_em_asm':
-      em_asm_stop = globals_[export.index]
+      assert export.index > num_global_imports
+      em_asm_stop = globals_[export.index - num_global_imports]
     elif export.kind in (webassembly.ExternType.FUNC, webassembly.ExternType.GLOBAL):
       metadata['exports'].append(export.name)
 
@@ -428,7 +432,6 @@
 
   metadata['globalImports'] = [i.field for i in imports if i.kind == webassembly.ExternType.GLOBAL]
   metadata['namedGlobals'] = {}
-  metadata['features'] = []
   metadata['mainReadsParams'] = True
 
   tables = [i for i in imports if i.kind == webassembly.ExternType.TABLE]
@@ -496,7 +499,6 @@
 
   if settings.DEBUG_LEVEL >= 3:
     args.append('--dwarf')
-  print(modify_wasm)
   if modify_wasm or settings.GENERATE_SOURCE_MAP or memfile:
     stdout = building.run_binaryen_command('wasm-emscripten-finalize',
                                            infile=infile,
diff --git a/tests/test_core.py b/tests/test_core.py
index 11a1d60..9ebbe04 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -63,9 +63,11 @@
 
 def also_with_wasm_bigint(f):
   def decorated(self):
-    self.set_setting('WASM_BIGINT', 0)
-    f(self)
+    print('without WASM_BIGINT')
+    self.clear_setting('WASM_BIGINT')
+    #f(self)
     if self.is_wasm():
+      print('with WASM_BIGINT')
       self.set_setting('WASM_BIGINT')
       self.node_args.append('--experimental-wasm-bigint')
       self.js_engines = [config.NODE_JS]
diff --git a/tools/webassembly.py b/tools/webassembly.py
index 850dea8..60fc4c7 100644
--- a/tools/webassembly.py
+++ b/tools/webassembly.py
@@ -141,6 +141,7 @@
 
 
 class OpCode(IntEnum):
+  GLOBAL_GET = 0x23
   I32_CONST = 0x41
   I64_CONST = 0x42
   END = 0x0b