diff --git a/Foreign/CUDA/Driver/Marshal.chs b/Foreign/CUDA/Driver/Marshal.chs
--- a/Foreign/CUDA/Driver/Marshal.chs
+++ b/Foreign/CUDA/Driver/Marshal.chs
@@ -133,7 +133,7 @@
 --
 registerArray :: Storable a => [AllocFlag] -> Int -> Ptr a -> IO (HostPtr a)
 #if CUDA_VERSION < 4000
-registerArray _     _ = requireSDK 4.0 "registerArray"
+registerArray _ _ _   = requireSDK 4.0 "registerArray"
 #else
 registerArray flags n = go undefined
   where
diff --git a/Foreign/CUDA/Runtime.hs b/Foreign/CUDA/Runtime.hs
--- a/Foreign/CUDA/Runtime.hs
+++ b/Foreign/CUDA/Runtime.hs
@@ -15,7 +15,6 @@
   module Foreign.CUDA.Runtime.Error,
   module Foreign.CUDA.Runtime.Exec,
   module Foreign.CUDA.Runtime.Marshal,
-  module Foreign.CUDA.Runtime.Thread,
   module Foreign.CUDA.Runtime.Utils
 
 ) where
@@ -25,6 +24,5 @@
 import Foreign.CUDA.Runtime.Error
 import Foreign.CUDA.Runtime.Exec
 import Foreign.CUDA.Runtime.Marshal
-import Foreign.CUDA.Runtime.Thread              ( exit )
 import Foreign.CUDA.Runtime.Utils
 
diff --git a/Foreign/CUDA/Runtime/Error.chs b/Foreign/CUDA/Runtime/Error.chs
--- a/Foreign/CUDA/Runtime/Error.chs
+++ b/Foreign/CUDA/Runtime/Error.chs
@@ -23,10 +23,11 @@
 import Foreign.CUDA.Internal.C2HS
 
 -- System
-import Foreign
+import Foreign                                  hiding ( unsafePerformIO )
 import Foreign.C
 import Data.Typeable
 import Control.Exception.Extensible
+import System.IO.Unsafe
 
 #include "cbits/stubs.h"
 #include <cuda_runtime_api.h>
diff --git a/Foreign/CUDA/Runtime/Thread.chs b/Foreign/CUDA/Runtime/Thread.chs
deleted file mode 100644
--- a/Foreign/CUDA/Runtime/Thread.chs
+++ /dev/null
@@ -1,70 +0,0 @@
---------------------------------------------------------------------------------
--- |
--- Module    : Foreign.CUDA.Runtime.Thread
--- Copyright : (c) [2009..2011] Trevor L. McDonell
--- License   : BSD
---
--- Thread management routines
---
---------------------------------------------------------------------------------
-
-module Foreign.CUDA.Runtime.Thread
-  {-# DEPRECATED "superseded by functions in Device module" #-} (
-
-  -- * Cache configuration
-  D.Limit(..),
-  getLimit, setLimit,
-
-  -- * Thread management
-  sync, exit
-
-) where
-
-import qualified Foreign.CUDA.Runtime.Device      as D
-
---------------------------------------------------------------------------------
--- Thread management
---------------------------------------------------------------------------------
-
--- |
--- Block until the device has completed all preceding requested tasks. Returns
--- an error if one of the tasks fails.
---
-sync :: IO ()
-sync = D.sync
-#if CUDART_VERSION >= 4000
-{-# DEPRECATED exit "use 'Foreign.CUDA.Runtime.Device.sync' instead" #-}
-#endif
-
-
--- |
--- Explicitly clean up all runtime related resources associated with the calling
--- host thread. Any subsequent API call re-initialised the environment.
--- Implicitly called on thread exit.
---
-exit :: IO ()
-exit = D.reset
-#if CUDART_VERSION >= 4000
-{-# DEPRECATED exit "use 'Foreign.CUDA.Runtime.Device.reset' instead" #-}
-#endif
-
-
--- |
--- Query compute 2.0 call stack limits. Requires cuda-3.1.
---
-getLimit :: D.Limit -> IO Int
-getLimit = D.getLimit
-#if CUDART_VERSION >= 4000
-{-# DEPRECATED exit "use 'Foreign.CUDA.Runtime.Device.getLimit' instead" #-}
-#endif
-
-
--- |
--- Set compute 2.0 call stack limits. Requires cuda-3.1.
---
-setLimit :: D.Limit -> Int -> IO ()
-setLimit = D.setLimit
-#if CUDART_VERSION >= 4000
-{-# DEPRECATED exit "use 'Foreign.CUDA.Runtime.Device.setLimit' instead" #-}
-#endif
-
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -2861,6 +2861,14 @@
 echo "${ECHO_T}no" >&6; }
 fi
 
+# If we are running on Mac OS add the CUDA library path to the search list. This
+# option allows applications to run without requiring to set [DY]LD_LIBRARY_PATH
+#
+case $build in
+    *darwin* ) LDFLAGS+=" -Xlinker -rpath ${cuda_prefix}/lib " ;;
+    * ) ;;
+esac
+
 # Make sure both the driver and runtime are found
 #
 longerror='
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,14 @@
     AC_MSG_RESULT(no)
 fi
 
+# If we are running on Mac OS add the CUDA library path to the search list. This
+# option allows applications to run without requiring to set [DY]LD_LIBRARY_PATH
+#
+case $build in
+    *darwin* ) LDFLAGS+=" -Xlinker -rpath ${cuda_prefix}/lib " ;;
+    * ) ;;
+esac
+
 # Make sure both the driver and runtime are found
 #
 longerror='
diff --git a/cuda.cabal b/cuda.cabal
--- a/cuda.cabal
+++ b/cuda.cabal
@@ -1,5 +1,5 @@
 Name:                   cuda
-Version:                0.4.0.0
+Version:                0.4.0.1
 Synopsis:               FFI binding to the CUDA interface for programming NVIDIA GPUs
 Description:
     The CUDA library provides a direct, general purpose C-like SPMD programming
@@ -48,7 +48,6 @@
                         Foreign.CUDA.Runtime.Marshal
                         Foreign.CUDA.Runtime.Stream
                         Foreign.CUDA.Runtime.Texture
-                        Foreign.CUDA.Runtime.Thread
                         Foreign.CUDA.Runtime.Utils
                         Foreign.CUDA.Driver
                         Foreign.CUDA.Driver.Context
