diff --git a/Data/Repa/Scalar/Singleton/Nat.hs b/Data/Repa/Scalar/Singleton/Nat.hs
--- a/Data/Repa/Scalar/Singleton/Nat.hs
+++ b/Data/Repa/Scalar/Singleton/Nat.hs
@@ -2,7 +2,7 @@
 {-# LANGUAGE UndecidableInstances #-}
 
 -- | Singleton-typed natural numbers and arithmetic.
--- 
+--
 --   Used for indexing into hetrogenous list types.
 --
 module Data.Repa.Scalar.Singleton.Nat
@@ -38,7 +38,7 @@
  add  :: Nat x -> Nat y -> Nat (AddR x y)
 
 instance Add Z x where
- type AddR Z y   = y
+ type AddR Z x   = x
  add Zero y      = y
  {-# INLINE add #-}
 
@@ -55,10 +55,10 @@
  mul  :: Nat x -> Nat y -> Nat (MulR x y)
 
 instance Mul Z x where
- type MulR  Z       y = Z
+ type MulR  Z       x = Z
  mul        Zero    _ = Zero
 
-instance (Mul x y, Add (MulR x y) y) 
+instance (Mul x y, Add (MulR x y) y)
        => Mul (S x) y where
  type MulR (S x)    y = AddR (MulR x y) y
  mul       (Succ x) y = add  (mul  x y) y
diff --git a/repa-scalar.cabal b/repa-scalar.cabal
--- a/repa-scalar.cabal
+++ b/repa-scalar.cabal
@@ -1,5 +1,5 @@
 Name:           repa-scalar
-Version:        4.2.3.1
+Version:        4.2.3.2
 License:        BSD3
 License-file:   LICENSE
 Author:         The Repa Development Team
@@ -18,10 +18,10 @@
   location: https://github.com/DDCSF/repa.git
 
 Library
-  build-Depends: 
-        base              == 4.9.*,
-        primitive         == 0.6.*,
-        vector            == 0.10.*,
+  build-Depends:
+        base              >= 4.9  && < 4.11,
+        primitive         >= 0.6  && < 0.8,
+        vector            >= 0.10 && < 0.13,
         bytestring        == 0.10.*,
         double-conversion == 2.0.*,
         time              == 1.6.*
