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/SetupWrapper.hs b/SetupWrapper.hs
--- a/SetupWrapper.hs
+++ b/SetupWrapper.hs
@@ -115,9 +115,9 @@
       when outOfDate $ do
         debug verbosity "Setup script is out of date, compiling..."
 
-        (comp,  _, conf) <- configCompilerEx (Just GHC) Nothing Nothing
+        (comp, _, conf) <- configCompilerEx (Just GHC) Nothing Nothing
                              defaultProgramConfiguration verbosity
-        cabalLibVersion  <- cabalLibVersionToUse comp conf
+        cabalLibVersion <- cabalLibVersionToUse comp conf
         let cabalPkgid = PackageIdentifier (PackageName "Cabal") cabalLibVersion
         debug verbosity $ "Using Cabal library version " ++ display cabalLibVersion
 
diff --git a/System/Glib/GError.chs b/System/Glib/GError.chs
--- a/System/Glib/GError.chs
+++ b/System/Glib/GError.chs
@@ -149,7 +149,7 @@
 class Enum err => GErrorClass err where
   gerrorDomain :: err -> GErrorDomain -- ^ This must not use the value of its
                                       -- parameter so that it is safe to pass
-				      -- 'undefined'.
+                                      -- 'undefined'.
 
 -- | Glib functions which report 'GError's take as a parameter a @GError
 -- **error@. Use this function to supply such a parameter. It checks if an
diff --git a/System/Glib/GList.chs b/System/Glib/GList.chs
--- a/System/Glib/GList.chs
+++ b/System/Glib/GList.chs
@@ -43,8 +43,8 @@
   ) where
 
 import Foreign
-import Control.Exception	(bracket)
-import Control.Monad		(foldM)
+import Control.Exception        (bracket)
+import Control.Monad            (foldM)
 
 {# context lib="glib" prefix="g" #}
 
@@ -58,7 +58,7 @@
 readGList :: GList -> IO [Ptr a]
 readGList glist
   | glist==nullPtr = return []
-  | otherwise	    = do
+  | otherwise       = do
     x <- {#get GList->data#} glist
     glist' <- {#get GList->next#} glist
     xs <- readGList glist'
@@ -74,16 +74,16 @@
     extractList gl xs
       | gl==nullPtr = return xs
       | otherwise   = do
-	x <- {#get GList.data#} gl
-	gl' <- {#call unsafe list_delete_link#} gl gl
-	extractList gl' (castPtr x:xs)
+        x <- {#get GList.data#} gl
+        gl' <- {#call unsafe list_delete_link#} gl gl
+        extractList gl' (castPtr x:xs)
 
 -- Turn a GSList into a list of pointers but don't destroy the list.
 --
 readGSList :: GSList -> IO [Ptr a]
 readGSList gslist
   | gslist==nullPtr = return []
-  | otherwise	    = do
+  | otherwise       = do
     x <- {#get GSList->data#} gslist
     gslist' <- {#get GSList->next#} gslist
     xs <- readGSList gslist'
@@ -94,7 +94,7 @@
 fromGSList :: GSList -> IO [Ptr a]
 fromGSList gslist
   | gslist==nullPtr = return []
-  | otherwise	    = do
+  | otherwise       = do
     x <- {#get GSList->data#} gslist
     gslist' <- {#call unsafe slist_delete_link#} gslist gslist
     xs <- fromGSList gslist'
@@ -108,10 +108,10 @@
   where
     extractList gslist xs
       | gslist==nullPtr = return xs
-      | otherwise	= do
-	x <- {#get GSList->data#} gslist
-	gslist' <- {#call unsafe slist_delete_link#} gslist gslist
-	extractList gslist' (castPtr x:xs)
+      | otherwise       = do
+        x <- {#get GSList->data#} gslist
+        gslist' <- {#call unsafe slist_delete_link#} gslist gslist
+        extractList gslist' (castPtr x:xs)
 
 -- Turn a list of something into a GList.
 --
diff --git a/System/Glib/GObject.chs b/System/Glib/GObject.chs
--- a/System/Glib/GObject.chs
+++ b/System/Glib/GObject.chs
@@ -188,7 +188,7 @@
   let propName = "Gtk2HsAttr"++show cnt
   attr <- quarkFromString $ T.pack propName
   return (newNamedAttr propName (objectGetAttributeUnsafe attr)
-	                        (objectSetAttribute attr))
+                                (objectSetAttribute attr))
 
 -- | The address of a function freeing a 'StablePtr'. See 'destroyFunPtr'.
 foreign import ccall unsafe "&hs_free_stable_ptr" destroyStablePtr :: DestroyNotify
@@ -201,7 +201,7 @@
 objectSetAttribute attr obj (Just val) = do
   sPtr <- newStablePtr val
   {#call object_set_qdata_full#} (toGObject obj) attr (castStablePtrToPtr sPtr)
-				 destroyStablePtr
+                                 destroyStablePtr
 
 -- | Get the value of an association.
 --
@@ -219,7 +219,7 @@
 --
 isA :: GObjectClass o => o -> GType -> Bool
 isA obj gType =
-	typeInstanceIsA ((unsafeForeignPtrToPtr.castForeignPtr.unGObject.toGObject) obj) gType
+        typeInstanceIsA ((unsafeForeignPtrToPtr.castForeignPtr.unGObject.toGObject) obj) gType
 
 -- at this point we would normally implement the notify signal handler;
 -- I've moved this definition into the Object class of the gtk package
diff --git a/System/Glib/GString.chs b/System/Glib/GString.chs
--- a/System/Glib/GString.chs
+++ b/System/Glib/GString.chs
@@ -49,7 +49,7 @@
 readGString :: GString -> IO (Maybe String)
 readGString gstring
   | gstring == nullPtr = return Nothing
-  | otherwise	       = do
+  | otherwise          = do
     gstr <- {#get GString->str#} gstring
     len <- {#get GString->len#} gstring
     fmap Just $ peekCStringLen (gstr, fromIntegral len)
@@ -69,7 +69,7 @@
 fromGString :: GString -> IO (Maybe String)
 fromGString gstring
   | gstring == nullPtr = return Nothing
-  | otherwise	       = do
+  | otherwise          = do
     gstr <- {#get GString->str#} gstring
     len <- {#get GString->len#} gstring
     str <- fmap Just $ peekCStringLen (gstr, fromIntegral len)
diff --git a/System/Glib/GTypeConstants.hsc b/System/Glib/GTypeConstants.hsc
--- a/System/Glib/GTypeConstants.hsc
+++ b/System/Glib/GTypeConstants.hsc
@@ -37,27 +37,27 @@
   boxed
   ) where
 
-import System.Glib.GType	(GType)
+import System.Glib.GType        (GType)
 
 #include<glib-object.h>
 
 invalid, none, uint, int, uint64, int64, uchar, char, bool, enum, flags,
  pointer, float, double, string, object, boxed :: GType
 
-invalid	= #const G_TYPE_INVALID
-none	= #const G_TYPE_NONE
-uint	= #const G_TYPE_UINT
-int	= #const G_TYPE_INT
-uint64	= #const G_TYPE_UINT64
-int64	= #const G_TYPE_INT64
-uchar	= #const G_TYPE_UCHAR
-char	= #const G_TYPE_CHAR
-bool	= #const G_TYPE_BOOLEAN
-enum	= #const G_TYPE_ENUM
-flags	= #const G_TYPE_FLAGS
-pointer	= #const G_TYPE_POINTER
-float	= #const G_TYPE_FLOAT
-double	= #const G_TYPE_DOUBLE
-string	= #const G_TYPE_STRING
-object	= #const G_TYPE_OBJECT
-boxed	= #const G_TYPE_BOXED
+invalid = #const G_TYPE_INVALID
+none    = #const G_TYPE_NONE
+uint    = #const G_TYPE_UINT
+int     = #const G_TYPE_INT
+uint64  = #const G_TYPE_UINT64
+int64   = #const G_TYPE_INT64
+uchar   = #const G_TYPE_UCHAR
+char    = #const G_TYPE_CHAR
+bool    = #const G_TYPE_BOOLEAN
+enum    = #const G_TYPE_ENUM
+flags   = #const G_TYPE_FLAGS
+pointer = #const G_TYPE_POINTER
+float   = #const G_TYPE_FLOAT
+double  = #const G_TYPE_DOUBLE
+string  = #const G_TYPE_STRING
+object  = #const G_TYPE_OBJECT
+boxed   = #const G_TYPE_BOXED
diff --git a/System/Glib/GValue.chs b/System/Glib/GValue.chs
--- a/System/Glib/GValue.chs
+++ b/System/Glib/GValue.chs
@@ -35,7 +35,7 @@
   ) where
 
 import System.Glib.FFI
-import System.Glib.GType	(GType)
+import System.Glib.GType        (GType)
 
 {# context lib="glib" prefix="g" #}
 
diff --git a/System/Glib/GValueTypes.chs b/System/Glib/GValueTypes.chs
--- a/System/Glib/GValueTypes.chs
+++ b/System/Glib/GValueTypes.chs
@@ -64,12 +64,12 @@
   valueGetMaybeGObject,
   ) where
 
-import Control.Monad	(liftM)
+import Control.Monad    (liftM)
 
 import System.Glib.FFI
 import System.Glib.Flags
 import System.Glib.UTFString
-{#import System.Glib.GValue#}		(GValue(GValue))
+{#import System.Glib.GValue#}           (GValue(GValue))
 import System.Glib.GObject
 
 {# context lib="glib" prefix="g" #}
diff --git a/System/Glib/MainLoop.chs b/System/Glib/MainLoop.chs
--- a/System/Glib/MainLoop.chs
+++ b/System/Glib/MainLoop.chs
@@ -61,11 +61,11 @@
 #endif
   ) where
 
-import Control.Monad	(liftM)
+import Control.Monad    (liftM)
 
 import System.Glib.FFI
 import System.Glib.Flags
-import System.Glib.GObject	(DestroyNotify, destroyFunPtr)
+import System.Glib.GObject      (DestroyNotify, destroyFunPtr)
 
 {#context lib="glib" prefix ="g"#}
 
@@ -142,13 +142,13 @@
 
 -- | Flags representing a condition to watch for on a file descriptor.
 --
--- [@IOIn@]		There is data to read.
--- [@IOOut@]		Data can be written (without blocking).
--- [@IOPri@]		There is urgent data to read.
--- [@IOErr@]		Error condition.
--- [@IOHup@]		Hung up (the connection has been broken, usually for
+-- [@IOIn@]             There is data to read.
+-- [@IOOut@]            Data can be written (without blocking).
+-- [@IOPri@]            There is urgent data to read.
+-- [@IOErr@]            Error condition.
+-- [@IOHup@]            Hung up (the connection has been broken, usually for
 --                      pipes and sockets).
--- [@IOInvalid@]	Invalid request. The file descriptor is not open.
+-- [@IOInvalid@]        Invalid request. The file descriptor is not open.
 --
 {# enum IOCondition {
           G_IO_IN   as IOIn,
diff --git a/System/Glib/Properties.chs b/System/Glib/Properties.chs
--- a/System/Glib/Properties.chs
+++ b/System/Glib/Properties.chs
@@ -113,13 +113,13 @@
 
 import System.Glib.FFI
 import System.Glib.UTFString
-import System.Glib.Flags	(Flags)
+import System.Glib.Flags        (Flags)
 {#import System.Glib.Types#}
-{#import System.Glib.GValue#}	(GValue(GValue), valueInit, allocaGValue)
+{#import System.Glib.GValue#}   (GValue(GValue), valueInit, allocaGValue)
 import qualified System.Glib.GTypeConstants as GType
 import System.Glib.GType
 import System.Glib.GValueTypes
-import System.Glib.Attributes	(Attr, ReadAttr, WriteAttr, ReadWriteAttr,
+import System.Glib.Attributes   (Attr, ReadAttr, WriteAttr, ReadWriteAttr,
                                 newNamedAttr, readNamedAttr, writeNamedAttr)
 
 {# context lib="glib" prefix="g" #}
diff --git a/System/Glib/StoreValue.hsc b/System/Glib/StoreValue.hsc
--- a/System/Glib/StoreValue.hsc
+++ b/System/Glib/StoreValue.hsc
@@ -32,7 +32,7 @@
   valueGetGenericValue,
   ) where
 
-import Control.Monad	(liftM)
+import Control.Monad    (liftM)
 import Data.Text (Text)
 
 import Control.Exception  (throw, AssertionFailed(..))
@@ -40,45 +40,45 @@
 #include<glib-object.h>
 
 import System.Glib.FFI
-import System.Glib.GValue	(GValue, valueInit, valueGetType)
+import System.Glib.GValue       (GValue, valueInit, valueGetType)
 import System.Glib.GValueTypes
 import qualified System.Glib.GTypeConstants as GType
-import System.Glib.Types	(GObject)
+import System.Glib.Types        (GObject)
 
 -- | A union with information about the currently stored type.
 --
 -- * Internally used by "Graphics.UI.Gtk.TreeList.TreeModel".
 --
 data GenericValue = GVuint    Word
-		  | GVint     Int
---		  | GVuchar   #{type guchar}
---		  | GVchar    #{type gchar}
-		  | GVboolean Bool
-		  | GVenum    Int
-		  | GVflags   Int
---		  | GVpointer (Ptr ())
-		  | GVfloat   Float
-		  | GVdouble  Double
-		  | GVstring  (Maybe Text)
-		  | GVobject  GObject
---		  | GVboxed   (Ptr ())
+                  | GVint     Int
+--                | GVuchar   #{type guchar}
+--                | GVchar    #{type gchar}
+                  | GVboolean Bool
+                  | GVenum    Int
+                  | GVflags   Int
+--                | GVpointer (Ptr ())
+                  | GVfloat   Float
+                  | GVdouble  Double
+                  | GVstring  (Maybe Text)
+                  | GVobject  GObject
+--                | GVboxed   (Ptr ())
 
 -- This is an enumeration of all GTypes that can be used in a TreeModel.
 --
 data TMType = TMinvalid
-	    | TMuint
-	    | TMint
---	    | TMuchar
---	    | TMchar
-	    | TMboolean
-	    | TMenum
-	    | TMflags
---	    | TMpointer
-	    | TMfloat
-	    | TMdouble
-	    | TMstring
-	    | TMobject
---	    | TMboxed
+            | TMuint
+            | TMint
+--          | TMuchar
+--          | TMchar
+            | TMboolean
+            | TMenum
+            | TMflags
+--          | TMpointer
+            | TMfloat
+            | TMdouble
+            | TMstring
+            | TMobject
+--          | TMboxed
 
 instance Enum TMType where
   fromEnum TMinvalid = #const G_TYPE_INVALID
@@ -97,19 +97,19 @@
 --  fromEnum TMboxed   = #const G_TYPE_BOXED
   toEnum #{const G_TYPE_INVALID} = TMinvalid
   toEnum #{const G_TYPE_UINT}    = TMuint
-  toEnum #{const G_TYPE_INT}	 = TMint
+  toEnum #{const G_TYPE_INT}     = TMint
 --  toEnum #{const G_TYPE_UCHAR} = TMuchar
---  toEnum #{const G_TYPE_CHAR}	 = TMchar
+--  toEnum #{const G_TYPE_CHAR}  = TMchar
   toEnum #{const G_TYPE_BOOLEAN} = TMboolean
-  toEnum #{const G_TYPE_ENUM}	 = TMenum
-  toEnum #{const G_TYPE_FLAGS}	 = TMflags
+  toEnum #{const G_TYPE_ENUM}    = TMenum
+  toEnum #{const G_TYPE_FLAGS}   = TMflags
 --  toEnum #{const G_TYPE_POINTER} = TMpointer
-  toEnum #{const G_TYPE_FLOAT}	 = TMfloat
-  toEnum #{const G_TYPE_DOUBLE}	 = TMdouble
-  toEnum #{const G_TYPE_STRING}	 = TMstring
-  toEnum #{const G_TYPE_OBJECT}	 = TMobject
---  toEnum #{const G_TYPE_BOXED}	 = TMboxed
-  toEnum _			 =
+  toEnum #{const G_TYPE_FLOAT}   = TMfloat
+  toEnum #{const G_TYPE_DOUBLE}  = TMdouble
+  toEnum #{const G_TYPE_STRING}  = TMstring
+  toEnum #{const G_TYPE_OBJECT}  = TMobject
+--  toEnum #{const G_TYPE_BOXED}         = TMboxed
+  toEnum _                       =
     error "StoreValue.toEnum(TMType): no dynamic types allowed."
 
 valueSetGenericValue :: GValue -> GenericValue -> IO ()
@@ -140,18 +140,18 @@
 valueGetGenericValue gvalue = do
   gtype <- valueGetType gvalue
   case (toEnum . fromIntegral) gtype of
-    TMinvalid	-> throw $ AssertionFailed
+    TMinvalid   -> throw $ AssertionFailed
       "StoreValue.valueGetGenericValue: invalid or unavailable value."
-    TMuint    -> liftM GVuint			  $ valueGetUInt    gvalue
-    TMint	-> liftM GVint	                  $ valueGetInt	    gvalue
---    TMuchar	-> liftM GVuchar		  $ valueGetUChar   gvalue
---    TMchar	-> liftM GVchar			  $ valueGetChar    gvalue
-    TMboolean	-> liftM GVboolean		  $ valueGetBool    gvalue
-    TMenum	-> liftM (GVenum . fromIntegral)  $ valueGetUInt    gvalue
-    TMflags	-> liftM (GVflags . fromIntegral) $ valueGetUInt    gvalue
---    TMpointer	-> liftM GVpointer		  $ valueGetPointer gvalue
-    TMfloat	-> liftM GVfloat		  $ valueGetFloat   gvalue
-    TMdouble	-> liftM GVdouble		  $ valueGetDouble  gvalue
-    TMstring	-> liftM GVstring		  $ valueGetMaybeString  gvalue
-    TMobject	-> liftM GVobject		  $ valueGetGObject gvalue
---    TMboxed   -> liftM GVpointer		  $ valueGetPointer gvalue
+    TMuint    -> liftM GVuint                     $ valueGetUInt    gvalue
+    TMint       -> liftM GVint                    $ valueGetInt     gvalue
+--    TMuchar   -> liftM GVuchar                  $ valueGetUChar   gvalue
+--    TMchar    -> liftM GVchar                   $ valueGetChar    gvalue
+    TMboolean   -> liftM GVboolean                $ valueGetBool    gvalue
+    TMenum      -> liftM (GVenum . fromIntegral)  $ valueGetUInt    gvalue
+    TMflags     -> liftM (GVflags . fromIntegral) $ valueGetUInt    gvalue
+--    TMpointer -> liftM GVpointer                $ valueGetPointer gvalue
+    TMfloat     -> liftM GVfloat                  $ valueGetFloat   gvalue
+    TMdouble    -> liftM GVdouble                 $ valueGetDouble  gvalue
+    TMstring    -> liftM GVstring                 $ valueGetMaybeString  gvalue
+    TMobject    -> liftM GVobject                 $ valueGetGObject gvalue
+--    TMboxed   -> liftM GVpointer                $ valueGetPointer gvalue
diff --git a/System/Glib/UTFString.hs b/System/Glib/UTFString.hs
--- a/System/Glib/UTFString.hs
+++ b/System/Glib/UTFString.hs
@@ -109,9 +109,16 @@
     -- Escape percent signs (used in MessageDialog)
     unPrintf :: s -> s
 
+-- GTK+ has a lot of asserts that the ptr is not NULL even if the length is 0
+-- Until they fix this we need to fudge pointer values to keep the noise level
+-- in the logs.
+noNullPtrs :: CStringLen -> CStringLen
+noNullPtrs (p, 0) | p == nullPtr = (plusPtr p 1, 0)
+noNullPtrs s = s
+
 instance GlibString [Char] where
     withUTFString = withCAString . encodeString
-    withUTFStringLen = withCAStringLen . encodeString
+    withUTFStringLen s f = withCAStringLen (encodeString s) (f . noNullPtrs)
     peekUTFString = liftM decodeString . peekCAString
     maybePeekUTFString = liftM (maybe Nothing (Just . decodeString)) . maybePeek peekCAString
     peekUTFStringLen = liftM decodeString . peekCAStringLen
@@ -135,7 +142,7 @@
 
 instance GlibString T.Text where
     withUTFString = useAsCString . encodeUtf8
-    withUTFStringLen = T.withCStringLen
+    withUTFStringLen s f = T.withCStringLen s (f . noNullPtrs)
     peekUTFString s = do
         len <- c_strlen s
         T.peekCStringLen (s, fromIntegral len)
diff --git a/glib.cabal b/glib.cabal
--- a/glib.cabal
+++ b/glib.cabal
@@ -1,5 +1,5 @@
 Name:           glib
-Version:        0.13.1.0
+Version:        0.13.1.1
 License:        LGPL-2.1
 License-file:   COPYING
 Copyright:      (c) 2001-2010 The Gtk2Hs Team
@@ -38,7 +38,7 @@
                         bytestring >= 0.9.1.10 && < 0.11,
                         text >= 1.0.0.0 && < 1.3,
                         containers
-        build-tools:    gtk2hsC2hs >= 0.13.12
+        build-tools:    gtk2hsC2hs >= 0.13.13
         cpp-options:    -U__BLOCKS__ -D__attribute__(A)=
         if flag(closure_signals)
           cpp-options:  -DUSE_GCLOSURE_SIGNALS_IMPL
