diff --git a/library/PostgreSQL/Binary/Decoder.hs b/library/PostgreSQL/Binary/Decoder.hs
--- a/library/PostgreSQL/Binary/Decoder.hs
+++ b/library/PostgreSQL/Binary/Decoder.hs
@@ -87,9 +87,13 @@
 {-# INLINABLE onContent #-}
 onContent :: Decoder a -> Decoder ( Maybe a )
 onContent decoder =
-  intOfSize 4 >>= \case
+  size >>=
+  \case
     (-1) -> pure Nothing
-    n -> fmap Just (sized n decoder)
+    n -> fmap Just (sized (fromIntegral n) decoder)
+  where
+    size =
+      intOfSize 4 :: Decoder Int32
 
 {-# INLINABLE content #-}
 content :: Decoder (Maybe ByteString)
@@ -429,21 +433,30 @@
 {-# INLINE composite #-}
 composite :: CompositeDecoder a -> Decoder a
 composite (CompositeDecoder decoder) =
-  unitOfSize 4 *> decoder
+  numOfComponents *> decoder
+  where
+    numOfComponents =
+      unitOfSize 4
 
 -- |
 -- Lift a value 'Decoder' into 'CompositeDecoder'.
 {-# INLINE compositeValue #-}
 compositeValue :: Decoder a -> CompositeDecoder ( Maybe a )
-compositeValue =
-  CompositeDecoder . onContent
+compositeValue valueDecoder =
+  CompositeDecoder (skipOid *> onContent valueDecoder)
+  where
+    skipOid =
+      unitOfSize 4
 
 -- |
 -- Lift a non-nullable value 'Decoder' into 'CompositeDecoder'.
 {-# INLINE compositeNonNullValue #-}
 compositeNonNullValue :: Decoder a -> CompositeDecoder a
-compositeNonNullValue =
-  CompositeDecoder . join . fmap (maybe (failure "Unexpected NULL") return) . onContent
+compositeNonNullValue valueDecoder =
+  CompositeDecoder (skipOid *> onContent valueDecoder >>= maybe (failure "Unexpected NULL") return)
+  where
+    skipOid =
+      unitOfSize 4
 
 
 -- * Array
diff --git a/postgresql-binary.cabal b/postgresql-binary.cabal
--- a/postgresql-binary.cabal
+++ b/postgresql-binary.cabal
@@ -1,7 +1,7 @@
 name:
   postgresql-binary
 version:
-  0.9.1
+  0.9.1.1
 synopsis:
   Encoders and decoders for the PostgreSQL's binary format
 description:
diff --git a/tasty/Main.hs b/tasty/Main.hs
--- a/tasty/Main.hs
+++ b/tasty/Main.hs
@@ -36,6 +36,24 @@
             else []
         other =
           [
+            let
+              sql =
+                "select (1, 'a')"
+              decoder _ =
+                Decoder.composite ((,) <$> Decoder.compositeNonNullValue Decoder.int <*> Decoder.compositeNonNullValue Decoder.char)
+              expected =
+                (1 :: Int64, 'a')
+              in select sql decoder expected
+            ,
+            let
+              sql =
+                "select (1, null)"
+              decoder _ =
+                Decoder.composite ((,) <$> Decoder.compositeNonNullValue Decoder.int <*> Decoder.compositeValue Decoder.char)
+              expected =
+                (1 :: Int64, Nothing :: Maybe Char)
+              in select sql decoder expected
+            ,
             select "SELECT '1 year 2 months 3 days 4 hours 5 minutes 6 seconds 332211 microseconds' :: interval"
             (bool Decoder.interval_float Decoder.interval_int)
             (picosecondsToDiffTime (10^6 * (332211 + 10^6 * (6 + 60 * (5 + 60 * (4 + 24 * (3 + 31 * (2 + 12))))))))
