diff --git a/Data/Array/CArray/Base.hs b/Data/Array/CArray/Base.hs
--- a/Data/Array/CArray/Base.hs
+++ b/Data/Array/CArray/Base.hs
@@ -1,6 +1,9 @@
-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, MagicHash,
-  FlexibleInstances, FlexibleContexts, UnboxedTuples, DeriveDataTypeable, CPP,
-  BangPatterns #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE BangPatterns #-}
 #ifdef __GLASGOW_HASKELL__
 #if __GLASGOW_HASKELL__ < 610
 {-# OPTIONS_GHC -frewrite-rules #-}
@@ -54,8 +57,7 @@
 import Foreign.Storable
 import Foreign.ForeignPtr
 import Foreign.Ptr
-import Foreign.Marshal.Alloc
-import Foreign.Marshal.Array    (copyArray)
+import Foreign.Marshal.Array    (copyArray, withArray)
 import Data.Word                ()
 
 import Data.Generics            (Data(..), Typeable(..))
@@ -143,10 +145,10 @@
 -- the range specified is larger than the size of the ByteString or the start of
 -- the ByteString does not fulfil the alignment requirement of the resulting
 -- CArray (as specified by the Storable instance).
-unsafeByteStringToCArray :: (Ix i, Storable e, IArray CArray e)
+unsafeByteStringToCArray :: (Ix i, Storable e)
                             => (i,i) -> S.ByteString -> Maybe (CArray i e)
 unsafeByteStringToCArray lu bs = go undefined lu
-    where go :: (Ix i, Storable e, IArray CArray e) => e -> (i,i) -> Maybe (CArray i e)
+    where go :: (Ix i, Storable e) => e -> (i,i) -> Maybe (CArray i e)
           go dummy (l,u) | safe = Just (CArray l u n fp)
                          | otherwise = Nothing
               where n = rangeSize (l,u)
@@ -213,14 +215,11 @@
 -- | Hackish way to get the zero element for a Storable type.
 {-# NOINLINE zeroElem #-}
 zeroElem :: Storable a => a -> a
-zeroElem u = unsafePerformIO $ do
-    allocaBytes n $ \p -> do
-        sequence_ [pokeByteOff p off (0 :: Word8) | off <- [0 .. n - 1] ]
-        peek (castPtr p)
-    where n = sizeOf u
+zeroElem u = unsafePerformIO $
+    withArray (replicate (sizeOf u) (0 :: Word8)) $ peek . castPtr
 
 {-# INLINE unsafeArrayCArray #-}
-unsafeArrayCArray :: (MArray IOCArray e IO, Storable e, Ix i)
+unsafeArrayCArray :: (Storable e, Ix i)
                   => (i,i) -> [(Int, e)] -> e -> IO (CArray i e)
 unsafeArrayCArray lu ies default_elem = do
         marr <- newArray lu default_elem
@@ -228,7 +227,7 @@
         unsafeFreezeIOCArray marr
 
 {-# INLINE unsafeReplaceCArray #-}
-unsafeReplaceCArray :: (MArray IOCArray e IO, Storable e, Ix i)
+unsafeReplaceCArray :: (Storable e, Ix i)
                        => CArray i e -> [(Int, e)] -> IO (CArray i e)
 unsafeReplaceCArray arr ies = do
     marr <- thawIOCArray arr
@@ -236,7 +235,7 @@
     unsafeFreezeIOCArray marr
 
 {-# INLINE unsafeAccumCArray #-}
-unsafeAccumCArray :: (MArray IOCArray e IO, Storable e, Ix i)
+unsafeAccumCArray :: (Storable e, Ix i)
                             => (e -> e' -> e) -> CArray i e -> [(Int, e')]
                                               -> IO (CArray i e)
 unsafeAccumCArray f arr ies = do
@@ -248,7 +247,7 @@
     unsafeFreezeIOCArray marr
 
 {-# INLINE unsafeAccumArrayCArray #-}
-unsafeAccumArrayCArray :: (MArray IOCArray e IO, Storable e, Ix i)
+unsafeAccumArrayCArray :: (Storable e, Ix i)
                           => (e -> e' -> e) -> e -> (i,i) -> [(Int, e')]
                                             -> IO (CArray i e)
 unsafeAccumArrayCArray f e0 lu ies = do
@@ -260,7 +259,7 @@
     unsafeFreezeIOCArray marr
 
 {-# INLINE eqCArray #-}
-eqCArray :: (IArray CArray e, Ix i, Eq e)
+eqCArray :: (Storable e, Ix i, Eq e)
                    => CArray i e -> CArray i e -> Bool
 eqCArray arr1@(CArray l1 u1 n1 _) arr2@(CArray l2 u2 n2 _) =
     if n1 == 0 then n2 == 0 else
@@ -268,12 +267,12 @@
            and [unsafeAt arr1 i == unsafeAt arr2 i | i <- [0 .. n1 - 1]]
 
 {-# INLINE cmpCArray #-}
-cmpCArray :: (IArray CArray e, Ix i, Ord e)
+cmpCArray :: (Storable e, Ix i, Ord e)
                     => CArray i e -> CArray i e -> Ordering
 cmpCArray arr1 arr2 = compare (assocs arr1) (assocs arr2)
 
 {-# INLINE cmpIntCArray #-}
-cmpIntCArray :: (IArray CArray e, Ord e)
+cmpIntCArray :: (Storable e, Ord e)
                        => CArray Int e -> CArray Int e -> Ordering
 cmpIntCArray arr1@(CArray l1 u1 n1 _) arr2@(CArray l2 u2 n2 _) =
     if n1 == 0 then if n2 == 0 then EQ else LT else
@@ -288,13 +287,13 @@
 
 {-# RULES "cmpCArray/Int" cmpCArray = cmpIntCArray #-}
 
-instance (Ix ix, Eq e, IArray CArray e) => Eq (CArray ix e) where
+instance (Ix ix, Eq e, Storable e) => Eq (CArray ix e) where
     (==) = eqCArray
 
-instance (Ix ix, Ord e, IArray CArray e) => Ord (CArray ix e) where
+instance (Ix ix, Ord e, Storable e) => Ord (CArray ix e) where
     compare = cmpCArray
 
-instance (Ix ix, Show ix, Show e, IArray CArray e) => Show (CArray ix e) where
+instance (Ix ix, Show ix, Show e, Storable e) => Show (CArray ix e) where
     showsPrec = showsIArray
 
 --
@@ -403,7 +402,7 @@
 -- retain any reference to the original.  It flagrantly breaks referential
 -- transparency!
 {-# INLINE mapCArrayInPlace #-}
-mapCArrayInPlace :: (Ix i, IArray CArray e, Storable e) => (e -> e) -> CArray i e -> CArray i e
+mapCArrayInPlace :: (Ix i, Storable e) => (e -> e) -> CArray i e -> CArray i e
 mapCArrayInPlace f a = S.inlinePerformIO $ do
     withCArray a $ \p ->
         forM_ [0 .. size a - 1] $ \i ->
diff --git a/Makefile b/Makefile
new file mode 100644
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+test:
+	runhaskell Setup configure --user
+	runhaskell Setup build
+	runhaskell Setup haddock
+	(cd tests; sh runtests.sh)
diff --git a/carray.cabal b/carray.cabal
--- a/carray.cabal
+++ b/carray.cabal
@@ -1,5 +1,5 @@
 name:                carray
-version:             0.1.5.1
+version:             0.1.5.2
 synopsis:            A C-compatible array library.
 description:
 		     A C-compatible array library.
@@ -12,9 +12,9 @@
 license:             BSD3
 license-file:        LICENSE
 author:              Jed Brown
-maintainer:          Jed Brown <jed@59A2.org>
+maintainer:          Jed Brown <jed@59A2.org>, Henning Thielemann <fft@henning-thielemann.de>
 stability:	     experimental
-cabal-version:       >=1.2
+cabal-version:       >=1.6
 build-type:	     Simple
 
 extra-source-files: tests/meteor-contest-c.hs
@@ -24,7 +24,18 @@
                     tests/nsieve-bits-u.hs
                     tests/tests.hs
                     tests/runtests.sh
+                    Makefile
 
+source-repository this
+  tag:         0.1.5.2
+  type:        darcs
+  location:    http://code.haskell.org/carray/
+
+source-repository head
+  type:        darcs
+  location:    http://code.haskell.org/carray/
+
+
 flag splitBase
   description: array was in base < 3
 flag bytestringInBase
@@ -33,16 +44,16 @@
   description: syb was split from base >= 4 
 
 library
-  build-depends:   ix-shapable
+  build-depends:   ix-shapable, binary
   if flag(bytestringInBase)
-    build-depends: base >= 2.0 && < 2.2, binary
+    build-depends: base >= 2.0 && < 2.2
   else
-    build-depends: base < 2.0 || >= 3, bytestring, binary
+    build-depends: base < 2.0 || >= 3, bytestring
 
   if flag(splitBase)
-    build-depends: base >= 3, array, binary
+    build-depends: base >= 3, array
   else
-    build-depends: base < 3, binary
+    build-depends: base < 3
 
   if flag(base4)
     build-depends: base >= 4 && < 5, syb >= 0.1
diff --git a/tests/nsieve-bits-c.hs b/tests/nsieve-bits-c.hs
--- a/tests/nsieve-bits-c.hs
+++ b/tests/nsieve-bits-c.hs
@@ -13,7 +13,7 @@
 import Data.Array.Base
 import Data.Array.CArray.Base
 import System.IO.Unsafe (unsafePerformIO)
-import System
+import System.Environment
 import Control.Monad
 import Data.Bits
 import Text.Printf
diff --git a/tests/nsieve-bits-s.hs b/tests/nsieve-bits-s.hs
--- a/tests/nsieve-bits-s.hs
+++ b/tests/nsieve-bits-s.hs
@@ -13,7 +13,7 @@
 import Data.Array.Storable
 import Data.Array.Base
 import System.IO.Unsafe (unsafePerformIO)
-import System
+import System.Environment
 import Control.Monad
 import Data.Bits
 import Text.Printf
diff --git a/tests/nsieve-bits-u.hs b/tests/nsieve-bits-u.hs
--- a/tests/nsieve-bits-u.hs
+++ b/tests/nsieve-bits-u.hs
@@ -12,7 +12,7 @@
 import Control.Monad.ST
 import Data.Array.ST
 import Data.Array.Base
-import System
+import System.Environment
 import Control.Monad
 import Data.Bits
 import Text.Printf
