diff --git a/Statistics/Distribution.hs b/Statistics/Distribution.hs
--- a/Statistics/Distribution.hs
+++ b/Statistics/Distribution.hs
@@ -65,7 +65,8 @@
         P dx' x' | pdf /= 0   = P (err / pdf) (x - dx)
                  | otherwise  = P dx x
         P dx'' x''
-            | x' < lo' || x' > hi' || pdf == 0 = P (x'-x) ((lo + hi) / 2)
+            | x' < lo' || x' > hi' || pdf == 0 = let y = (lo' + hi') / 2
+                                                 in  P (y-x) y
             | otherwise                        = P dx' x'
     accuracy = 1e-15
     maxIters = 150
diff --git a/Statistics/Distribution/Normal.hs b/Statistics/Distribution/Normal.hs
--- a/Statistics/Distribution/Normal.hs
+++ b/Statistics/Distribution/Normal.hs
@@ -24,7 +24,6 @@
 import Data.Number.Erf (erfc)
 import Data.Typeable (Typeable)
 import Statistics.Constants (m_huge, m_sqrt_2, m_sqrt_2_pi)
-import Statistics.Types (Sample)
 import qualified Statistics.Distribution as D
 import qualified Statistics.Sample as S
 
@@ -65,7 +64,7 @@
                  }
     where sv = sqrt v
 
-fromSample :: Sample -> NormalDistribution
+fromSample :: S.Sample -> NormalDistribution
 fromSample a = fromParams (S.mean a) (S.variance a)
 
 density :: NormalDistribution -> Double -> Double
diff --git a/statistics.cabal b/statistics.cabal
--- a/statistics.cabal
+++ b/statistics.cabal
@@ -1,5 +1,5 @@
 name:           statistics
-version:        0.3
+version:        0.3.1
 synopsis:       A library of statistical types, data, and functions
 description:
   This library provides a number of common functions and types useful
@@ -65,6 +65,6 @@
   -- gather extensive profiling data for now
   ghc-prof-options: -auto-all
 
-  ghc-options: -Wall -funbox-strict-fields -O2 -fvia-C
+  ghc-options: -Wall -funbox-strict-fields -O2
   if impl(ghc >= 6.8)
     ghc-options: -fwarn-tabs
