diff --git a/Network/TLS/Core.hs b/Network/TLS/Core.hs
--- a/Network/TLS/Core.hs
+++ b/Network/TLS/Core.hs
@@ -181,7 +181,7 @@
 	liftIO $ (loggingIOSent $ ctxLogging ctx) dataToSend
 	liftIO $ connectionSend ctx dataToSend
 	where
-                isNonNullAppData (AppData b) = B.null b
+                isNonNullAppData (AppData b) = not $ B.null b
                 isNonNullAppData _           = False
 
 -- | Create a new Client context with a configuration, a RNG, a generic connection and the connection operation.
diff --git a/Tests.hs b/Tests.hs
--- a/Tests.hs
+++ b/Tests.hs
@@ -154,6 +154,8 @@
 		printAndRaise :: String -> SomeException -> IO ()
 		printAndRaise s e = putStrLn (s ++ " exception: " ++ show e) >> throw e
 
+recvDataNonNull ctx = recvData' ctx >>= \l -> if L.null l then recvDataNonNull ctx else return l
+
 prop_handshake_initiate :: PropertyM IO ()
 prop_handshake_initiate = do
 	params       <- pick arbitraryPairParams
@@ -171,7 +173,7 @@
 	where
 		tlsServer ctx queue = do
 			handshake ctx
-			d <- recvData' ctx
+			d <- recvDataNonNull ctx
 			writeChan queue d
 			return ()
 		tlsClient queue ctx = do
@@ -198,7 +200,7 @@
 	where
 		tlsServer ctx queue = do
 			handshake ctx
-			d <- recvData' ctx
+			d <- recvDataNonNull ctx
 			writeChan queue d
 			return ()
 		tlsClient queue ctx = do
@@ -244,7 +246,7 @@
 	where
 		tlsServer ctx queue = do
 			handshake ctx
-			d <- recvData' ctx
+			d <- recvDataNonNull ctx
 			writeChan queue d
 			return ()
 		tlsClient queue ctx = do
diff --git a/tls.cabal b/tls.cabal
--- a/tls.cabal
+++ b/tls.cabal
@@ -1,5 +1,5 @@
 Name:                tls
-Version:             0.9.9
+Version:             0.9.10
 Description:
    Native Haskell TLS and SSL protocol implementation for server and client.
    .
