diff --git a/purescript.cabal b/purescript.cabal
--- a/purescript.cabal
+++ b/purescript.cabal
@@ -1,5 +1,5 @@
 name: purescript
-version: 0.4.20
+version: 0.5.0
 cabal-version: >=1.8
 build-type: Custom
 license: MIT
diff --git a/src/Language/PureScript/CodeGen/JS.hs b/src/Language/PureScript/CodeGen/JS.hs
--- a/src/Language/PureScript/CodeGen/JS.hs
+++ b/src/Language/PureScript/CodeGen/JS.hs
@@ -56,13 +56,15 @@
 moduleToJs :: ModuleType -> Options -> Module -> Environment -> [JS]
 moduleToJs mt opts (Module name decls (Just exps)) env = case mt of
   CommonJS -> moduleBody ++ [JSAssignment (JSAccessor "exports" (JSVar "module")) moduleExports]
-  Globals ->
+  Globals | not isModuleEmpty ->
     [ JSVariableIntroduction (fromJust (optionsBrowserNamespace opts))
                              (Just (JSBinary Or (JSVar (fromJust (optionsBrowserNamespace opts))) (JSObjectLiteral [])) )
     , JSAssignment (JSAccessor (moduleNameToJs name) (JSVar (fromJust (optionsBrowserNamespace opts))))
                    (JSApp (JSFunction Nothing [] (JSBlock (moduleBody ++ [JSReturn moduleExports]))) [])
     ]
+  _ -> []
   where
+  isModuleEmpty = null jsDecls
   moduleBody = JSStringLiteral "use strict" : jsImports ++ jsDecls
   moduleExports = JSObjectLiteral $ concatMap exportToJs exps
   jsDecls = (concat $ mapMaybe (\decl -> fmap (map $ optimize opts) $ declToJs opts name decl env) decls)
diff --git a/src/Language/PureScript/TypeChecker/Types.hs b/src/Language/PureScript/TypeChecker/Types.hs
--- a/src/Language/PureScript/TypeChecker/Types.hs
+++ b/src/Language/PureScript/TypeChecker/Types.hs
@@ -421,6 +421,7 @@
 -- Check that two types unify
 --
 unifiesWith :: Environment -> Type -> Type -> Bool
+unifiesWith _ (TUnknown u1) (TUnknown u2) | u1 == u2 = True
 unifiesWith _ (Skolem _ s1 _) (Skolem _ s2 _) | s1 == s2 = True
 unifiesWith _ (TypeVar v1) (TypeVar v2) | v1 == v2 = True
 unifiesWith _ (TypeConstructor c1) (TypeConstructor c2) | c1 == c2 = True
