diff --git a/htiled.cabal b/htiled.cabal
--- a/htiled.cabal
+++ b/htiled.cabal
@@ -1,5 +1,5 @@
 Name:                htiled
-Version:             0.1.3.0
+Version:             0.1.4.0
 Synopsis:            Import from the Tiled map editor.
 Description:         Import maps from the .tmx map format generated by Tiled,
                      <http://www.mapeditor.org>.
@@ -18,7 +18,13 @@
 Library
   Hs-Source-Dirs:    src
   Exposed-Modules:   Data.Tiled, Data.Tiled.Types, Data.Tiled.Load
-  Build-depends:       base ==4.*, zlib ==0.5.*, bytestring
-                     , hxt == 9.*, base64-bytestring > 1
-                     , containers >=0.4 && <0.6, filepath, split
+  Build-depends:       base >= 4.0 && < 5.0
+                     , zlib >= 0.5
+                     , bytestring
+                     , hxt >= 9.0
+                     , base64-bytestring > 1
+                     , containers >=0.4 && <0.6
+                     , filepath
+                     , split
+
   Ghc-Options:       -Wall
diff --git a/src/Data/Tiled/Load.hs b/src/Data/Tiled/Load.hs
--- a/src/Data/Tiled/Load.hs
+++ b/src/Data/Tiled/Load.hs
@@ -128,7 +128,10 @@
                                 \gzip/zlib and csv are supported at the moment."
 
     toMap w h = fromDistinctAscList . sort . filter (\(_, x) → tileGid x /= 0)
-                . zip [(x, y) | y ← [0..h-1], x ← [0..w-1]]
+                . zipWith (\ndx t -> ((x w ndx, y w ndx), t)) [0..]
+
+    x w ndx = ndx - (y w ndx) * fromIntegral w
+    y w ndx = floor $ fromIntegral ndx / fromIntegral w
 
     base64 f = wordsToTiles . bytesToWords . LBS.unpack . f . LBS.fromChunks
                             . (:[]) . B64.decodeLenient . BS.pack
