diff --git a/Gtk2HsSetup.hs b/Gtk2HsSetup.hs
--- a/Gtk2HsSetup.hs
+++ b/Gtk2HsSetup.hs
@@ -429,15 +429,10 @@
   let modDeps = zipWith (ModDep True []) expMods mExpFiles++
                 zipWith (ModDep False []) othMods mOthFiles
   modDeps <- mapM extractDeps modDeps
-  let (expMods, othMods) = span mdExposed $ sortTopological modDeps
-      badOther = map (fromMaybe "<no file>" . mdLocation) $
-                 filter (not . mdExposed) expMods
-  unless (null badOther) $
-    die ("internal chs modules "++intercalate "," badOther++
-         " depend on exposed chs modules; cabal needs to build internal modules first")
+  let (othMods, expMods) = span (not . mdExposed) $ reverse $ sortTopological modDeps
   return pd { PD.library = Just lib {
-    PD.exposedModules = map mdOriginal expMods,
-    PD.libBuildInfo = bi { PD.otherModules = map mdOriginal othMods }
+    PD.exposedModules = map mdOriginal (reverse expMods),
+    PD.libBuildInfo = bi { PD.otherModules = map mdOriginal (reverse othMods) }
   }}
 
 data ModDep = ModDep {
diff --git a/SetupMain.hs b/SetupMain.hs
--- a/SetupMain.hs
+++ b/SetupMain.hs
@@ -10,4 +10,4 @@
 main = do
   checkGtk2hsBuildtools [typeGenProgram, signalGenProgram, c2hsLocal]
   defaultMainWithHooks gtk2hsUserHooks
-  
+
diff --git a/SetupWrapper.hs b/SetupWrapper.hs
--- a/SetupWrapper.hs
+++ b/SetupWrapper.hs
@@ -18,7 +18,7 @@
 
 import System.Environment
 import System.Process
-import System.Exit
+import System.Exit (ExitCode(..), exitWith)
 import System.FilePath
 import System.Directory
 import qualified Control.Exception as Exception
diff --git a/gconf.cabal b/gconf.cabal
--- a/gconf.cabal
+++ b/gconf.cabal
@@ -1,5 +1,5 @@
 Name:           gconf
-Version:        0.13.0.1
+Version:        0.13.0.2
 License:        LGPL-2.1
 License-file:   COPYING
 Copyright:      (c) 2001-2010 The Gtk2Hs Team
