     fail _              = NoData
 
 instance Storable a => Storable (Value a) where
-  sizeOf _ = sizeOf (undefined :: Bool) + sizeOf (undefined :: a)
-  alignment _ = 4
+  sizeOf _ = sizeOf (undefined :: a) + sizeOf (undefined :: Word8)
+  alignment _ = alignment (undefined :: a)
 
   {-# INLINE peek #-}
   peek p = do
-            let p1 = (castPtr p::Ptr Bool) `plusPtr` 1
-            t <- peek (castPtr p::Ptr Bool)
-            if t
+            let p1 = (castPtr p::Ptr Word8) `plusPtr` 1
+            t <- peek (castPtr p::Ptr Word8)
+            if t/=0
               then fmap Value (peekElemOff (castPtr p1 :: Ptr a) 0)
               else return NoData
 
   {-# INLINE poke #-}
   poke p x = case x of
-    NoData -> poke (castPtr p :: Ptr Bool) False
+    NoData -> poke (castPtr p :: Ptr Word8) 0
     Value a -> do
-        poke (castPtr p :: Ptr Bool) True
-        let p1 = (castPtr p :: Ptr Bool) `plusPtr` 1
+        poke (castPtr p :: Ptr Word8) 1
+        let p1 = (castPtr p :: Ptr Word8) `plusPtr` 1
         pokeElemOff (castPtr p1) 0 a
 
 isNoData :: Value a -> Bool

  -> GDAL s (Vector (Value a))
readBand band xoff yoff sx sy bx by = liftIO $
  readBandIO band xoff yoff sx sy bx by

-- | Unsafe lazy IO version of readBand.
--   *must* make sure vectors are evaluated inside the GDAL monad and in the

  -> Vector (Value a)
  -> GDAL s ()
writeBand band xoff yoff sx sy bx by uvec = do
  bNodata <- liftIO $ fmap (maybe nodata fromNodata) (c_bandNodataValue band)
  liftIO $ do
    let nElems    = bx * by
        (fp, len) = St.unsafeToForeignPtr0 vec
