diff --git a/Lava/Captain.hs b/Lava/Captain.hs
--- a/Lava/Captain.hs
+++ b/Lava/Captain.hs
@@ -32,7 +32,7 @@
 import System.IO.Unsafe
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/Eprover.hs b/Lava/Eprover.hs
--- a/Lava/Eprover.hs
+++ b/Lava/Eprover.hs
@@ -34,7 +34,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/Fixit.hs b/Lava/Fixit.hs
--- a/Lava/Fixit.hs
+++ b/Lava/Fixit.hs
@@ -30,7 +30,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/HeerHugo.hs b/Lava/HeerHugo.hs
--- a/Lava/HeerHugo.hs
+++ b/Lava/HeerHugo.hs
@@ -30,7 +30,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/Isc.hs b/Lava/Isc.hs
--- a/Lava/Isc.hs
+++ b/Lava/Isc.hs
@@ -18,7 +18,7 @@
 import Data.Array
 import Lava.MyST
 import Data.List(intersperse)
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------------------------------------------
@@ -52,8 +52,8 @@
  where
 --  execute = "/Scripts/isc "
   execute = "isc "
-	    ++ netfile ++ " "
-	    ++ (m2par m) ++ " " ++ show n
+            ++ netfile ++ " "
+            ++ (m2par m) ++ " " ++ show n
   netfile = verifyDir ++ "/circuit.net"
 
   m2par StepMin = "-smin"
@@ -89,9 +89,9 @@
 
 showA :: Array Int String -> String
 showA a = "array " ++ show (bounds a) ++ " [" ++
-	  concat (intersperse "," (map (\ (i,s) -> "(" ++ show i ++ "," ++ s ++ ")")
-		                         (assocs a)))
-	  ++ "]"
+          concat (intersperse "," (map (\ (i,s) -> "(" ++ show i ++ "," ++ s ++ ")")
+                                         (assocs a)))
+          ++ "]"
 
 showAll (n,p) = "(" ++ showN n ++ "," ++ show p ++ ")"
 
@@ -105,7 +105,7 @@
   do (props,_) <- properties a
      let top = case props of
                 [x] -> x
-		xs  -> andl xs
+                xs  -> andl xs
      let (tab, Object top') = table (struct top)
      return (array (0, length tab-1) tab, top')
 
@@ -118,29 +118,29 @@
 
        let define sym = do
              tab <- readSTRef table
-	     case sym of
-	       And xs -> bin Or (map sneg xs) >>= return . sneg
-	       Or xs  -> bin Or xs
-	       Xor xs -> bin Xor xs
---			    v <- new
---			    writeSTRef table ((v,x):tab)
---			    return (Not v)
-	       Inv x  -> return (sneg x)
-	       x      -> do v <- new
-			    writeSTRef table ((v,x):tab)
-			    return (Pos v)
+             case sym of
+               And xs -> bin Or (map sneg xs) >>= return . sneg
+               Or xs  -> bin Or xs
+               Xor xs -> bin Xor xs
+--                          v <- new
+--                          writeSTRef table ((v,x):tab)
+--                          return (Not v)
+               Inv x  -> return (sneg x)
+               x      -> do v <- new
+                            writeSTRef table ((v,x):tab)
+                            return (Pos v)
 
            bin f [x]      = return x
-	   bin f (x:y:xs) = do
+           bin f (x:y:xs) = do
                v <- new
-	       tab <- readSTRef table
-	       writeSTRef table ((v, f [x,y]) : tab)
-	       bin f (Pos v:xs)
+               tab <- readSTRef table
+               writeSTRef table ((v, f [x,y]) : tab)
+               bin f (Pos v:xs)
 
            new = do
-	     n <- readSTRef ref
-	     writeSTRef ref (n+1)
-	     return n
+             n <- readSTRef ref
+             writeSTRef ref (n+1)
+             return n
 
        str' <- netlistST_ define str
        tab  <- readSTRef table
diff --git a/Lava/Limmat.hs b/Lava/Limmat.hs
--- a/Lava/Limmat.hs
+++ b/Lava/Limmat.hs
@@ -30,7 +30,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/Modoc.hs b/Lava/Modoc.hs
--- a/Lava/Modoc.hs
+++ b/Lava/Modoc.hs
@@ -30,7 +30,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/MyST.hs b/Lava/MyST.hs
--- a/Lava/MyST.hs
+++ b/Lava/MyST.hs
@@ -13,6 +13,8 @@
   )
  where
 
+import Control.Applicative (Applicative (..))
+import Control.Monad (ap)
 import System.IO
 import System.IO.Unsafe
 import Data.IORef
@@ -25,6 +27,10 @@
 
 instance Functor (ST s) where
   fmap f (ST io) = ST (fmap f io)
+
+instance Applicative (ST s) where
+  pure  = return
+  (<*>) = ap
 
 instance Monad (ST s) where
   return a    = ST (return a)
diff --git a/Lava/Property.hs b/Lava/Property.hs
--- a/Lava/Property.hs
+++ b/Lava/Property.hs
@@ -22,8 +22,11 @@
 import Lava.Signal
 import Lava.Generic
 
+import Control.Applicative (Applicative (..))
+
 import Control.Monad
-  ( liftM2
+  ( ap
+  , liftM2
   , liftM3
   , liftM4
   , liftM5
@@ -45,6 +48,10 @@
 
 instance Functor Gen where
   fmap f (Gen m) = Gen (\t -> f (m t))
+
+instance Applicative Gen where
+  pure  = return
+  (<*>) = ap
 
 instance Monad Gen where
   return a =
diff --git a/Lava/Satnik.hs b/Lava/Satnik.hs
--- a/Lava/Satnik.hs
+++ b/Lava/Satnik.hs
@@ -30,7 +30,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/Satzoo.hs b/Lava/Satzoo.hs
--- a/Lava/Satzoo.hs
+++ b/Lava/Satzoo.hs
@@ -30,7 +30,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/Smv.hs b/Lava/Smv.hs
--- a/Lava/Smv.hs
+++ b/Lava/Smv.hs
@@ -30,7 +30,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/Verification.hs b/Lava/Verification.hs
--- a/Lava/Verification.hs
+++ b/Lava/Verification.hs
@@ -35,7 +35,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 verifyDir :: FilePath
diff --git a/Lava/Vhdl.hs b/Lava/Vhdl.hs
--- a/Lava/Vhdl.hs
+++ b/Lava/Vhdl.hs
@@ -32,7 +32,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/Vis.hs b/Lava/Vis.hs
--- a/Lava/Vis.hs
+++ b/Lava/Vis.hs
@@ -34,7 +34,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/Lava/Zchaff.hs b/Lava/Zchaff.hs
--- a/Lava/Zchaff.hs
+++ b/Lava/Zchaff.hs
@@ -30,7 +30,7 @@
 
 import Data.IORef
 
-import System.Cmd (system)
+import System.Process (system)
 import System.Exit (ExitCode(..))
 
 ----------------------------------------------------------------
diff --git a/chalmers-lava2000.cabal b/chalmers-lava2000.cabal
--- a/chalmers-lava2000.cabal
+++ b/chalmers-lava2000.cabal
@@ -1,5 +1,5 @@
 name:                chalmers-lava2000
-version:             1.4.1
+version:             1.5
 synopsis:            Hardware description EDSL
 description:         For more info, see the tutorial: <http://projects.haskell.org/chalmers-lava2000/Doc/tutorial.pdf>
 category:            Language, Hardware
