diff --git a/ms-tds.cabal b/ms-tds.cabal
--- a/ms-tds.cabal
+++ b/ms-tds.cabal
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: efad0660f5cf0042c8ade6a168534cd8a14bd8d00708563ceeb560d6e059d864
+-- hash: e73f8134a0778c8c83faddfeb4f635f7a931c6d2d51ff8069aae2428a0390f0a
 
 name:           ms-tds
-version:        0.3.0.0
+version:        0.3.0.1
 synopsis:       TDS Protocol implemented in Haskell
 description:    Please see the README on GitHub at <https://github.com/mitsuji/ms-tds#readme>
 category:       Database
diff --git a/src/Database/Tds/Message/DataStream.hs b/src/Database/Tds/Message/DataStream.hs
--- a/src/Database/Tds/Message/DataStream.hs
+++ b/src/Database/Tds/Message/DataStream.hs
@@ -235,12 +235,12 @@
 putTypeInfo (TIGUID) = Put.putWord8 0x24 >> Put.putWord8 16
 putTypeInfo (TIDecimalN p s) = do
   Put.putWord8 0x6a
-  Put.putWord8 $ precisionToLen p -- [TODO] test
+  Put.putWord8 $ (precisionToLen p) +1
   Put.putWord8 p
   Put.putWord8 s
 putTypeInfo (TINumericN p s) = do
   Put.putWord8 0x6c
-  Put.putWord8 $ precisionToLen p -- [TODO] test
+  Put.putWord8 $ (precisionToLen p) +1
   Put.putWord8 p
   Put.putWord8 s
 
diff --git a/src/Database/Tds/Primitives/DateTime.hs b/src/Database/Tds/Primitives/DateTime.hs
--- a/src/Database/Tds/Primitives/DateTime.hs
+++ b/src/Database/Tds/Primitives/DateTime.hs
@@ -36,14 +36,14 @@
 utcToBytes4 :: UTCTime -> (Word16,Word16)
 utcToBytes4 (UTCTime date time) =
   let
-    wday = fromIntegral $ diffDays (fromGregorian 1900 1 1) date
+    wday = fromIntegral $ diffDays date (fromGregorian 1900 1 1)
     wmin = truncate $ time / 60
   in (wday,wmin)
 
 utcToBytes8 :: UTCTime -> (Int32,Word32)
 utcToBytes8 (UTCTime date time) =
   let
-    iday = fromIntegral $ diffDays (fromGregorian 1900 1 1) date
+    iday = fromIntegral $ diffDays date (fromGregorian 1900 1 1)
     w3hsec = truncate $ time * 300
   in (iday,w3hsec)
 
diff --git a/src/Database/Tds/Primitives/Decimal.hs b/src/Database/Tds/Primitives/Decimal.hs
--- a/src/Database/Tds/Primitives/Decimal.hs
+++ b/src/Database/Tds/Primitives/Decimal.hs
@@ -108,7 +108,7 @@
     f 0 _ = []
     f len i =
       let
-        (d,m) = divMod i 0xff
+        (d,m) = divMod i 0x100
       in (fromIntegral m) : f (len-1) d
 
 
