diff --git a/bin/Test.hs b/bin/Test.hs
--- a/bin/Test.hs
+++ b/bin/Test.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
 import Sound.Pulse.Context
 import Sound.Pulse.Mainloop.Simple
 
diff --git a/pulseaudio.cabal b/pulseaudio.cabal
--- a/pulseaudio.cabal
+++ b/pulseaudio.cabal
@@ -10,7 +10,7 @@
 -- PVP summary:      +-+------- breaking API changes
 --                   | | +----- non-breaking API additions
 --                   | | | +--- code changes with no API change
-version:             0.0.1.0
+version:             0.0.1.1
 
 -- A short (one-line) description of the package.
 synopsis:            A low-level (incomplete) wrapper around the pulseaudio client asynchronous api
@@ -91,8 +91,6 @@
 
   ghc-options:         -Wall
 
-  extra-libraries:     pulse
-
 library
   -- Modules exported by the library.
   exposed-modules:      Sound.Pulse.Context
@@ -132,3 +130,5 @@
   default-language:    Haskell2010
   
   ghc-options:         -Wall
+  extra-libraries:     pulse
+
diff --git a/src/Sound/Pulse/Context.hs b/src/Sound/Pulse/Context.hs
--- a/src/Sound/Pulse/Context.hs
+++ b/src/Sound/Pulse/Context.hs
@@ -105,13 +105,13 @@
     -> Maybe String -- ^The server to connect to. If this is Nothing, connect to the default server.
     -> [ContextFlags] -- ^Flags to control the startup behaviour of the server.
     -- -> SpawnApi! -- TODO
-    -> IO ()
+    -> IO (Maybe Int)
 connectContext cxt serv flags = do
     let wrapper = maybe ($ nullPtr) (withCString) serv
     ret <- wrapper (\ptr -> pa_context_connect cxt ptr (contextFlagssToInt flags) nullPtr)
     if ret /= 0
-       then error ("Failed to connect to server :( " ++ show ret)
-       else return ()
+       then Just <$> getContextErr cxt
+       else return Nothing
 
 -- |This callback is leaked! if it's reset
 -- IMO the handler should stay forever aswell (even if just for loggin), so don't worry about it.
diff --git a/src/Sound/Pulse/Mainloop/Simple.hs b/src/Sound/Pulse/Mainloop/Simple.hs
--- a/src/Sound/Pulse/Mainloop/Simple.hs
+++ b/src/Sound/Pulse/Mainloop/Simple.hs
@@ -243,12 +243,12 @@
            mapM_ deferCallback actives
 
 -- |Loop in the pulse main loop until eternety
-doLoop :: MainloopImpl -> IO ()
+doLoop :: MainloopImpl -> IO Int
 doLoop impl = do
     doIteration impl
     cont <- readIORef $ implRunning impl
     if isJust cont
-       then putStrLn ("Ending Simpleloop: " ++ show cont)
+       then return (fromJust cont)
        else doLoop impl
 
 
@@ -368,5 +368,6 @@
     deferSetDestroy (PADeferEvent x) = atomicWriteIORef (deferDestroy x)
 
     quitLoop :: MainloopImpl -> Int -> IO ()
-    quitLoop impl = atomicWriteIORef (implRunning impl) . Just
-
+    quitLoop impl val = do
+        atomicWriteIORef (implRunning impl) $ Just val
+        wakeImpl impl
diff --git a/src/Sound/Pulse/Subscribe.hs b/src/Sound/Pulse/Subscribe.hs
--- a/src/Sound/Pulse/Subscribe.hs
+++ b/src/Sound/Pulse/Subscribe.hs
@@ -80,5 +80,5 @@
     funP <- mkSubscribeCB $ \_ ival idx _ ->
         fun (subscriptionEventFromInt ival) (fromIntegral idx)
     pa_context_set_subscribe_callback cxt funP nullPtr
-    sucP <- wrapSuccess (\b -> putStrLn ("Subscription success: " ++ show b))
+    sucP <- wrapSuccess (\_ -> return ())
     ptrToOperation =<< pa_context_subscribe cxt (subscriptionMasksToInt mask) sucP nullPtr
