diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,13 @@
+## [v1.4.1](https://github.com/diagrams/diagrams-lib/tree/v1.4.0.1) (2017-05-28)
+
+- New functions `embeddedImage` and `loadImageEmbBS` for loading
+  images.
+- Fix [#289](https://github.com/diagrams/diagrams-lib/issues/289)
+  which could have caused strange behavior in looped compilation mode
+  on 32-bit platforms.
+- Allow `intervals-0.8` and `directory-1.3`.
+- Minor fixes to compile with GHC 8.2.
+
 ## [v1.4.0.1](https://github.com/diagrams/diagrams-lib/tree/v1.4.0.1) (2016-11-07)
 
 - Fix test suite compilation problem ([#286](https://github.com/diagrams/diagrams-lib/issues/286))
diff --git a/diagrams-lib.cabal b/diagrams-lib.cabal
--- a/diagrams-lib.cabal
+++ b/diagrams-lib.cabal
@@ -1,5 +1,5 @@
 Name:                diagrams-lib
-Version:             1.4.0.1
+Version:             1.4.1
 Synopsis:            Embedded domain-specific language for declarative graphics
 Description:         Diagrams is a flexible, extensible EDSL for creating
                      graphics of many types.  Graphics can be created
@@ -100,7 +100,7 @@
                        Diagrams.TwoD.Types,
                        Diagrams.TwoD.Vector,
                        Diagrams.Util
-  Build-depends:       base >= 4.6 && < 4.10,
+  Build-depends:       base >= 4.6 && < 4.11,
                        containers >= 0.3 && < 0.6,
                        array >= 0.3 && < 0.6,
                        semigroups >= 0.3.4 && < 0.19,
@@ -112,7 +112,7 @@
                        colour >= 2.3.2 && < 2.4,
                        data-default-class < 0.2,
                        fingertree >= 0.1 && < 0.2,
-                       intervals >= 0.7 && < 0.8,
+                       intervals >= 0.7 && < 0.9,
                        lens >= 4.6 && < 4.16,
                        tagged >= 0.7,
                        optparse-applicative >= 0.11 && < 0.14,
@@ -124,14 +124,15 @@
                        distributive >=0.2.2 && < 1.0,
                        process >= 1.1 && < 1.5,
                        fsnotify >= 0.2.1 && < 0.3,
-                       directory >= 1.2 && < 1.3,
+                       directory >= 1.2 && < 1.4,
                        unordered-containers >= 0.2 && < 0.3,
                        text >= 0.7.1 && < 1.3,
                        mtl >= 2.0 && < 2.3,
                        transformers >= 0.3.0 && < 0.6.0,
                        profunctors >= 5.0 && < 6.0,
                        exceptions >= 0.6 && < 1.0,
-                       cereal >=0.4.1.1 && <0.6
+                       cereal >=0.4.1.1 && <0.6,
+                       bytestring >=0.9 && <0.11
   if impl(ghc < 7.6)
     Build-depends: ghc-prim
   Hs-source-dirs:      src
@@ -155,7 +156,7 @@
                , Diagrams.Test.Angle
                , Instances
   hs-source-dirs: test
-  build-depends:       base >= 4.2 && < 4.10,
+  build-depends:       base,
                        tasty >= 0.10 && < 0.12,
                        tasty-hunit >= 0.9.2 && < 0.10,
                        tasty-quickcheck >= 0.8 && < 0.9,
diff --git a/src/Diagrams/Backend/CmdLine.hs b/src/Diagrams/Backend/CmdLine.hs
--- a/src/Diagrams/Backend/CmdLine.hs
+++ b/src/Diagrams/Backend/CmdLine.hs
@@ -609,7 +609,7 @@
       putStrLn $ "Program args: " ++ unwords args'
       forever . threadDelay $ case os of
          -- https://ghc.haskell.org/trac/ghc/ticket/7325
-        "darwin" -> 5000000000000
+        "darwin" -> 2000000000
         _        -> maxBound
 
 recompile :: FilePath -> FilePath -> [String] -> IO ExitCode
diff --git a/src/Diagrams/Combinators.hs b/src/Diagrams/Combinators.hs
--- a/src/Diagrams/Combinators.hs
+++ b/src/Diagrams/Combinators.hs
@@ -113,7 +113,7 @@
 --   to alignment and envelope acts like a 1-dimensional segment
 --   oriented along the vector @v@, with local origin at its
 --   center. (Note, however, that it has an empty trace; for 2D struts
---   with a nonempty trace see 'strutR2', 'strutX', and 'strutY' from
+--   with a nonempty trace see 'strutR2' from
 --   "Diagrams.TwoD.Combinators".) Useful for manually creating
 --   separation between two diagrams.
 --
diff --git a/src/Diagrams/Names.hs b/src/Diagrams/Names.hs
--- a/src/Diagrams/Names.hs
+++ b/src/Diagrams/Names.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE MonoLocalBinds   #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Diagrams.Names
diff --git a/src/Diagrams/Parametric.hs b/src/Diagrams/Parametric.hs
--- a/src/Diagrams/Parametric.hs
+++ b/src/Diagrams/Parametric.hs
@@ -55,7 +55,7 @@
   --   with numeric scalars).
   domainUpper :: p -> N p
 
-  default domainUpper :: Num n => p -> n
+  default domainUpper :: Num (N p) => p -> N p
   domainUpper = const 1
 
 -- | Type class for querying the values of a parametric object at the
diff --git a/src/Diagrams/Segment.hs b/src/Diagrams/Segment.hs
--- a/src/Diagrams/Segment.hs
+++ b/src/Diagrams/Segment.hs
@@ -325,6 +325,11 @@
 reverseSegment (Linear (OffsetClosed v))       = straight (negated v)
 reverseSegment (Cubic c1 c2 (OffsetClosed x2)) = bezier3 (c2 ^-^ x2) (c1 ^-^ x2) (negated x2)
 
+-- Imitates I.elem for intervals<0.8 and I.member for intervals>=0.8
+member :: Ord a => a -> I.Interval a -> Bool
+member x (I.I a b) = x >= a && x <= b
+{-# INLINE member #-}
+
 instance (Metric v, OrderedField n)
       => HasArcLength (Segment Closed v n) where
 
@@ -339,9 +344,9 @@
   arcLengthToParam m s _ | arcLength m s == 0 = 0.5
   arcLengthToParam m s@(Linear {}) len = len / arcLength m s
   arcLengthToParam m s@(Cubic {})  len
-    | len `I.elem` I (-m/2) (m/2) = 0
+    | len `member` I (-m/2) (m/2) = 0
     | len < 0              = - arcLengthToParam m (fst (splitAtParam s (-1))) (-len)
-    | len `I.elem` slen    = 1
+    | len `member` slen    = 1
     | len > I.sup slen     = 2 * arcLengthToParam m (fst (splitAtParam s 2)) len
     | len < I.sup llen     = (*0.5) $ arcLengthToParam m l len
     | otherwise            = (+0.5) . (*0.5)
diff --git a/src/Diagrams/Trace.hs b/src/Diagrams/Trace.hs
--- a/src/Diagrams/Trace.hs
+++ b/src/Diagrams/Trace.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE MonoLocalBinds   #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Diagrams.Trace
diff --git a/src/Diagrams/Transform/Matrix.hs b/src/Diagrams/Transform/Matrix.hs
--- a/src/Diagrams/Transform/Matrix.hs
+++ b/src/Diagrams/Transform/Matrix.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE CPP            #-}
+{-# LANGUAGE MonoLocalBinds #-}
 
 -----------------------------------------------------------------------------
 -- |
@@ -64,7 +65,8 @@
 mat22 :: Floating n => Iso' (M22 n, V2 n) (T2 n)
 mat22 = iso (uncurry fromMat22) (mkMat &&& transl)
 
--- | Prism onto a 2D transformation from a 2x2 transform matrix and
---   translation vector (in which case the 'T3' will be invalid).
+-- | Prism onto a 3D transformation from a 3x3 transform matrix and
+--   translation vector. Does not check if the matrix is invertible
+--   (in which case the 'T3' will be invalid).
 mat33 :: Floating n => Iso' (M33 n, V3 n) (T3 n)
 mat33 = iso (uncurry fromMat33) (mkMat &&& transl)
diff --git a/src/Diagrams/TwoD/Image.hs b/src/Diagrams/TwoD/Image.hs
--- a/src/Diagrams/TwoD/Image.hs
+++ b/src/Diagrams/TwoD/Image.hs
@@ -25,7 +25,9 @@
       DImage(..), ImageData(..)
     , Embedded, External, Native
     , image
+    , embeddedImage
     , loadImageEmb
+    , loadImageEmbBS
     , loadImageExt
     , uncheckedImageRef
     , raster
@@ -48,6 +50,8 @@
 import Diagrams.Query
 import           Diagrams.TwoD.Types
 
+import           Data.ByteString
+
 import           Linear.Affine
 
 data Embedded deriving Typeable
@@ -103,17 +107,22 @@
 rectPath :: RealFloat n => n -> n -> Path V2 n
 rectPath = rect
 
--- | Use JuicyPixels to read an image in any format and wrap it in a 'DImage'.
+-- | Read a JuicyPixels @DynamicImage@ and wrap it in a 'DImage'.
 --   The width and height of the image are set to their actual values.
+embeddedImage :: Num n => DynamicImage -> DImage n Embedded
+embeddedImage img = DImage (ImageRaster img) w h mempty
+  where
+    w = dynamicMap imageWidth img
+    h = dynamicMap imageHeight img
+
+-- | Use JuicyPixels to read a file in any format and wrap it in a 'DImage'.
+--   The width and height of the image are set to their actual values.
 loadImageEmb :: Num n => FilePath -> IO (Either String (DImage n Embedded))
-loadImageEmb path = do
-  dImg <- readImage path
-  return $ case dImg of
-    Left msg  -> Left msg
-    Right img -> Right (DImage (ImageRaster img) w h mempty)
-      where
-        w = dynamicMap imageWidth img
-        h = dynamicMap imageHeight img
+loadImageEmb path = fmap embeddedImage `fmap` readImage path
+
+-- | A pure variant of 'loadImageEmb'
+loadImageEmbBS :: Num n => ByteString -> Either String (DImage n Embedded)
+loadImageEmbBS bs = embeddedImage `fmap` decodeImage bs
 
 -- | Check that a file exists, and use JuicyPixels to figure out
 --   the right size, but save a reference to the image instead
diff --git a/test/Diagrams/Test/Transform.hs b/test/Diagrams/Test/Transform.hs
--- a/test/Diagrams/Test/Transform.hs
+++ b/test/Diagrams/Test/Transform.hs
@@ -15,31 +15,31 @@
         testProperty "rotating a vector by a number then its additive inverse will yield the original vector" $
           \θ a -> rotate ((θ * (-1)) @@ deg) (rotate ((θ :: Double) @@ deg) (a ::  V2 Double)) =~ a
         , testProperty "under rotated allows scaling along an angle" $
-          \θ f a -> under (rotated ((θ :: Double) @@ deg)) (scaleX (f :: Double)) (a ::  V2 Double) == (rotate (negated (θ @@ deg)) . (scaleX f) . rotate (θ @@ deg)) a
+          \θ f a -> under (rotated ((θ :: Double) @@ deg)) (scaleX (f :: Double)) (a ::  V2 Double) =~ (rotate (negated (θ @@ deg)) . (scaleX f) . rotate (θ @@ deg)) a
         , testProperty "a rotation of 0 does nothing" $
           \a -> rotate (0 @@ deg) (a ::  V2 Double) =~ a
         , testProperty "adding 360 degrees to a turn does nothing" $
           \c a -> rotate (((c :: Double) + 360) @@ deg) (a ::  V2 Double) =~ rotate (c @@ deg) a
         , testProperty "over rotated allows scaling along x of a rotated shape" $
-          \θ f a -> over (rotated ((θ :: Double) @@ deg)) (scaleX (f :: Double)) (a ::  V2 Double) == (rotate (θ @@ deg) . (scaleX f) . rotate (negated (θ @@ deg))) a
+          \θ f a -> over (rotated ((θ :: Double) @@ deg)) (scaleX (f :: Double)) (a ::  V2 Double) =~ (rotate (θ @@ deg) . (scaleX f) . rotate (negated (θ @@ deg))) a
         , testProperty "scaleX" $
-          \f a b -> (scaleX (f :: Double)) (V2 (a ::  Double) b) == V2 (a * f) b
+          \f a b -> (scaleX (f :: Double)) (V2 (a ::  Double) b) =~ V2 (a * f) b
         , testProperty "scaleY" $
-          \f a b -> (scaleY (f :: Double)) (V2 (a ::  Double) b) == V2 a  (f * b)
+          \f a b -> (scaleY (f :: Double)) (V2 (a ::  Double) b) =~ V2 a  (f * b)
         , testProperty "reflectX" $
-          \a b -> reflectX (V2 (a ::  Double) b) == V2 (a * (-1))  b
+          \a b -> reflectX (V2 (a ::  Double) b) =~ V2 (a * (-1))  b
         , testProperty "reflectY" $
-          \a b -> reflectY (V2 (a ::  Double) b) == V2 a  ((-1) * b)
+          \a b -> reflectY (V2 (a ::  Double) b) =~ V2 a  ((-1) * b)
         , testProperty "reflectXY" $
-          \a b -> reflectXY (V2 (a ::  Double) b) == V2 b a
+          \a b -> reflectXY (V2 (a ::  Double) b) =~ V2 b a
         , testProperty "translate" $
-          \a b c d -> translateX (a :: Double) (translateY b (P (V2 c d ))) == P (V2 (a + c) (b + d))
+          \a b c d -> translateX (a :: Double) (translateY b (P (V2 c d ))) =~ P (V2 (a + c) (b + d))
         , testProperty "shear" $
-          \a b c d -> shearX (a :: Double) (shearY b (V2 c d)) == V2 ((c*b + d) * a + c) (c*b + d)
+          \a b c d -> shearX (a :: Double) (shearY b (V2 c d)) =~ V2 ((c*b + d) * a + c) (c*b + d)
         , testProperty "(1,0) rotateTo some dir will return normalised dir" $
           \(NonZero a) b -> rotateTo  (dir (V2 (a :: Double) b)) (V2 1 0) =~ signorm (V2 a b)
         , testProperty "rotates" $
-          \a c -> rotate ((a :: Double)@@ deg) (c :: V2 Double)   == rotate'' ((a :: Double)@@ deg) (c :: V2 Double) && rotate ((a :: Double)@@ deg) (c :: V2 Double)   == rotate' ((a :: Double)@@ deg) (c :: V2 Double)
+          \a c -> rotate ((a :: Double)@@ deg) (c :: V2 Double)   =~ rotate'' ((a :: Double)@@ deg) (c :: V2 Double) && rotate ((a :: Double)@@ deg) (c :: V2 Double)   =~ rotate' ((a :: Double)@@ deg) (c :: V2 Double)
         , testProperty "reflectAbout works for a vector" $
           \a b c d e f -> reflectAbout (P (V2 (a :: Double) b)) (dir (V2 c d)) (V2 e f) =~  over (rotated (atan2A' d c)) reflectY (V2 e f)
         , testProperty "reflectAbout works for a point" $
