diff --git a/Storage/Hashed/Index.hs b/Storage/Hashed/Index.hs
--- a/Storage/Hashed/Index.hs
+++ b/Storage/Hashed/Index.hs
@@ -121,7 +121,7 @@
         (namefp, nameoff, namel) = toForeignPtr name
     withForeignPtr fp $ \p ->
         withForeignPtr namefp $ \namep ->
-            do pokeByteOff p off namel
+            do pokeByteOff p off (xlate32 $ fromIntegral namel :: Int32)
                memcpy (plusPtr p $ off + 4)
                       (plusPtr namep nameoff)
                       (fromIntegral namel)
diff --git a/Storage/Hashed/Tree.hs b/Storage/Hashed/Tree.hs
--- a/Storage/Hashed/Tree.hs
+++ b/Storage/Hashed/Tree.hs
@@ -271,7 +271,7 @@
             if treeHash left `match` treeHash right
                then return (emptyTree, emptyTree)
                else diff left right
-  where match (Just h) (Just j) | h == j = True
+  where match (Just (Hash (_, h))) (Just (Hash (_, j))) | h == j = True
         match _ _ = False
         isFile (File _) = True
         isFile _ = False
diff --git a/hashed-storage.cabal b/hashed-storage.cabal
--- a/hashed-storage.cabal
+++ b/hashed-storage.cabal
@@ -1,5 +1,5 @@
 name:          hashed-storage
-version:       0.3.7
+version:       0.3.8
 synopsis:      Hashed file storage support code.
 
 description:   Support code for reading and manipulating hashed file storage
@@ -19,7 +19,7 @@
 category:      System
 build-type:    Custom
 cabal-version: >= 1.6
-extra-source-files: Bundled/sha2.h
+extra-source-files: Bundled/sha2.h, testdata.zip
 
 flag test
     default: False
diff --git a/testdata.zip b/testdata.zip
new file mode 100644
Binary files /dev/null and b/testdata.zip differ
