diff --git a/Data/CRF/Chain1/Dataset/Internal.hs b/Data/CRF/Chain1/Dataset/Internal.hs
--- a/Data/CRF/Chain1/Dataset/Internal.hs
+++ b/Data/CRF/Chain1/Dataset/Internal.hs
@@ -1,5 +1,9 @@
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TypeFamilies #-}
 
+
 module Data.CRF.Chain1.Dataset.Internal
 ( Ob (..)
 , Lb (..)
@@ -15,23 +19,30 @@
 , Ys
 ) where
 
-import Data.Vector.Generic.Base
-import Data.Vector.Generic.Mutable
+
+-- import Data.Vector.Generic.Base
+-- import Data.Vector.Generic.Mutable
 import Data.Binary (Binary)
 import Data.Ix (Ix)
 import qualified Data.Vector as V
 import qualified Data.Vector.Unboxed as U
+import           Data.Vector.Unboxed.Deriving
 
+
+
 -- | An observation.
 newtype Ob = Ob { unOb :: Int }
-    deriving ( Show, Read, Eq, Ord, Binary
-             , Vector U.Vector, MVector U.MVector, U.Unbox )
+    deriving ( Show, Read, Eq, Ord, Binary )
+--           GeneralizedNewtypeDeriving doesn't work for this in 7.8.2:
+--           , Vector U.Vector, MVector U.MVector, U.Unbox )
+derivingUnbox "Ob" [t| Ob -> Int |] [| unOb |] [| Ob |]
 
+
 -- | A label.
 newtype Lb = Lb { unLb :: Int }
-    deriving ( Show, Read, Eq, Ord, Binary
-             , Vector U.Vector, MVector U.MVector, U.Unbox
-	     , Num, Ix )
+    deriving ( Show, Read, Eq, Ord, Binary, Num, Ix )
+derivingUnbox "Lb" [t| Lb -> Int |] [| unLb |] [| Lb |]
+
 
 -- | Simple word represented by a list of its observations.
 newtype X = X { _unX :: U.Vector Ob }
diff --git a/Data/CRF/Chain1/Model.hs b/Data/CRF/Chain1/Model.hs
--- a/Data/CRF/Chain1/Model.hs
+++ b/Data/CRF/Chain1/Model.hs
@@ -1,4 +1,7 @@
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TypeFamilies #-}
 
 -- | Internal implementation of the CRF model.
 
@@ -29,14 +32,16 @@
 import qualified Data.Vector.Unboxed as U
 import qualified Data.Vector as V
 import qualified Data.Number.LogFloat as L
+import           Data.Vector.Unboxed.Deriving
 
 import Data.CRF.Chain1.Dataset.Internal
 import Data.CRF.Chain1.Feature
 
 -- | A feature index.  To every model feature a unique index is assigned.
 newtype FeatIx = FeatIx { unFeatIx :: Int }
-    deriving ( Show, Eq, Ord, Binary
-             , G.Vector U.Vector, G.MVector U.MVector, U.Unbox )
+    deriving ( Show, Eq, Ord, Binary) 
+             -- , G.Vector U.Vector, G.MVector U.MVector, U.Unbox )
+derivingUnbox "FeatIx" [t| FeatIx -> Int |] [| unFeatIx |] [| FeatIx |]
 
 -- | A label and a feature index determined by that label.
 type LbIx   = (Lb, FeatIx)
@@ -182,10 +187,6 @@
 sgValue :: Model -> Lb -> L.LogFloat
 sgValue crf (Lb x) = 
     case unFeatIx (sgIxsV crf U.! x) of
-        -- FIXME: shoule not be -Infinity? It looks like it doesn't
-        -- matter much for know, because that value is ignored anyway,
-        -- but the SFeature which is not a member of the model
-        -- should have probability of 0.
         -1 -> 0		
         ix -> L.logToLogFloat (values crf U.! ix)
 
diff --git a/Data/CRF/Chain1/Train.hs b/Data/CRF/Chain1/Train.hs
--- a/Data/CRF/Chain1/Train.hs
+++ b/Data/CRF/Chain1/Train.hs
@@ -77,9 +77,9 @@
     | doneTotal k == doneTotal (k - 1) = putStr "."
     | Just dataSet <- evalDataM = do
         let x = accuracy (crf { values = para }) dataSet
-        putStrLn ("\n" ++ "[" ++ show (doneTotal k) ++ "] f = " ++ show x)
+        putStrLn ("\n" ++ "[" ++ show (doneTotal k) ++ "] acc = " ++ show x)
     | otherwise =
-        putStrLn ("\n" ++ "[" ++ show (doneTotal k) ++ "] f = #")
+        putStrLn ("\n" ++ "[" ++ show (doneTotal k) ++ "] acc = #")
   where
     doneTotal :: Int -> Int
     doneTotal = floor . done
diff --git a/crf-chain1.cabal b/crf-chain1.cabal
--- a/crf-chain1.cabal
+++ b/crf-chain1.cabal
@@ -1,5 +1,5 @@
 name:               crf-chain1
-version:            0.2.1
+version:            0.2.2
 synopsis:           First-order, linear-chain conditional random fields
 description:
     The library provides efficient implementation of the first-order,
@@ -32,11 +32,12 @@
       , random
       , parallel
       , logfloat
-      , monad-codec >= 0.2 && < 0.3
+      , monad-codec         >= 0.2     && < 0.3
       , binary
-      , vector-binary
+      , vector-binary       >= 0.1     && < 0.2
       , data-lens
-      , sgd >= 0.2.1 && < 0.3
+      , sgd                 >= 0.2.1    && < 0.3
+      , vector-th-unbox     >= 0.2.1    && < 0.3
 
     exposed-modules:
         Data.CRF.Chain1
