diff --git a/.travis.yml b/.travis.yml
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,43 +1,41 @@
-env:
- - GHCVER=7.0.1 CABALVER=1.16
- - GHCVER=7.0.4 CABALVER=1.16
- - GHCVER=7.2.2 CABALVER=1.16
- - GHCVER=7.4.2 CABALVER=1.16
- - GHCVER=7.6.3 CABALVER=1.16
- - GHCVER=7.8.4 CABALVER=1.18
- - GHCVER=7.10.1 CABALVER=1.22
- - GHCVER=head CABALVER=1.22
+language: c
+sudo: false
 
 matrix:
+  include:
+    - env: CABALVER=1.16 GHCVER=7.4.2
+      addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
+    - env: CABALVER=1.16 GHCVER=7.6.3
+      addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
+    - env: CABALVER=1.18 GHCVER=7.8.4
+      addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
+    - env: CABALVER=1.22 GHCVER=7.10.1
+      addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1],sources: [hvr-ghc]}}
+    - env: CABALVER=head GHCVER=head
+      addons: {apt: {packages: [cabal-install-head,ghc-head],  sources: [hvr-ghc]}}
+
   allow_failures:
-   - env: GHCVER=7.0.1 CABALVER=1.16
-   - env: GHCVER=7.0.4 CABALVER=1.16
-   - env: GHCVER=7.2.2 CABALVER=1.16
-   - env: GHCVER=head CABALVER=1.22
+   - env: CABALVER=head GHCVER=head
 
 before_install:
- - travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- - travis_retry sudo apt-get update
- - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
- - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- - cabal --version
+ - export PATH=~/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
+ - export CABAL=cabal-$CABALVER
+ - travis_retry $CABAL update
+ - if [ "$CABALVER" = "1.22" ]; then $CABAL install Cabal-1.22.4.0; fi
+ - $CABAL --version
 
 install:
- - travis_retry cabal update
- - git clone https://github.com/ekmett/bifunctors.git
- - cd bifunctors
- - cabal install
- - cd ..
- - cabal install --enable-tests --only-dependencies
+ - $CABAL install --enable-tests --only-dependencies
 
 script:
- - cabal configure -v2 --enable-tests
- - cabal build
- - cabal sdist
+ - $CABAL configure -v2 --enable-tests
+ - $CABAL build
+ - $CABAL test
+ - $CABAL sdist
  - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
    cd dist/;
    if [ -f "$SRC_TGZ" ]; then
-      cabal install "$SRC_TGZ";
+      $CABAL install "$SRC_TGZ";
    else
       echo "expected '$SRC_TGZ' not found";
       exit 1;
diff --git a/README.markdown b/README.markdown
--- a/README.markdown
+++ b/README.markdown
@@ -1,7 +1,7 @@
 semigroupoids
 ==========
 
-[![Build Status](https://secure.travis-ci.org/ekmett/semigroupoids.png?branch=master)](http://travis-ci.org/ekmett/semigroupoids)
+[![Hackage](https://img.shields.io/hackage/v/semigroupoids.svg)](https://hackage.haskell.org/package/semigroupoids) [![Build Status](https://secure.travis-ci.org/ekmett/semigroupoids.png?branch=master)](http://travis-ci.org/ekmett/semigroupoids)
 
 A semigroupoid is a `Category` without `id`.
 
diff --git a/semigroupoids.cabal b/semigroupoids.cabal
--- a/semigroupoids.cabal
+++ b/semigroupoids.cabal
@@ -1,6 +1,6 @@
 name:          semigroupoids
 category:      Control, Comonads
-version:       5.0.0.2
+version:       5.0.0.3
 license:       BSD3
 cabal-version: >= 1.8
 license-file:  LICENSE
@@ -173,8 +173,8 @@
     buildable: False
   else
     build-depends:
-      base    >= 4.4 && < 5,
-      doctest >= 0.9.1 && < 0.10,
+      base      >= 4     && < 5,
+      doctest   >= 0.9.1 && < 0.10,
       directory >= 1.0,
       filepath
 
diff --git a/src/Data/Functor/Alt.hs b/src/Data/Functor/Alt.hs
--- a/src/Data/Functor/Alt.hs
+++ b/src/Data/Functor/Alt.hs
@@ -1,5 +1,9 @@
 {-# LANGUAGE CPP #-}
-{-# LANGUAGE Safe #-}
+
+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL <= 706 && defined(MIN_VERSION_comonad) && !(MIN_VERSION_comonad(3,0,3))
+{-# LANGUAGE Trustworthy #-}
+#endif
+
 #if __GLASGOW_HASKELL__ >= 711
 {-# LANGUAGE ConstrainedClassMethods #-}
 #endif
diff --git a/src/Data/Functor/Apply.hs b/src/Data/Functor/Apply.hs
--- a/src/Data/Functor/Apply.hs
+++ b/src/Data/Functor/Apply.hs
@@ -1,5 +1,8 @@
 {-# LANGUAGE CPP #-}
-{-# LANGUAGE Safe #-}
+
+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL <= 706 && defined(MIN_VERSION_comonad) && !(MIN_VERSION_comonad(3,0,3))
+{-# LANGUAGE Trustworthy #-}
+#endif
 -----------------------------------------------------------------------------
 -- |
 -- Copyright   :  (C) 2011-2015 Edward Kmett
diff --git a/src/Data/Functor/Bind.hs b/src/Data/Functor/Bind.hs
--- a/src/Data/Functor/Bind.hs
+++ b/src/Data/Functor/Bind.hs
@@ -1,12 +1,6 @@
 {-# LANGUAGE CPP #-}
 
-#ifdef MIN_VERSION_comonad
-#if __GLASGOW_HASKELL__ >= 707 && (MIN_VERSION_comonad(3,0,3))
-{-# LANGUAGE Safe #-}
-#else
-{-# LANGUAGE Trustworthy #-}
-#endif
-#else
+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL <= 706 && defined(MIN_VERSION_comonad) && !(MIN_VERSION_comonad(3,0,3))
 {-# LANGUAGE Trustworthy #-}
 #endif
 
diff --git a/src/Data/Functor/Bind/Class.hs b/src/Data/Functor/Bind/Class.hs
--- a/src/Data/Functor/Bind/Class.hs
+++ b/src/Data/Functor/Bind/Class.hs
@@ -4,13 +4,7 @@
 #define MIN_VERSION_semigroups(x,y,z) 1
 #endif
 
-#ifdef MIN_VERSION_comonad
-#if __GLASGOW_HASKELL__ >= 707 && (MIN_VERSION_comonad(3,0,3))
-{-# LANGUAGE Safe #-}
-#else
-{-# LANGUAGE Trustworthy #-}
-#endif
-#else
+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL <= 706 && defined(MIN_VERSION_comonad) && !(MIN_VERSION_comonad(3,0,3))
 {-# LANGUAGE Trustworthy #-}
 #endif
 
diff --git a/src/Data/Functor/Extend.hs b/src/Data/Functor/Extend.hs
--- a/src/Data/Functor/Extend.hs
+++ b/src/Data/Functor/Extend.hs
@@ -1,5 +1,8 @@
 {-# LANGUAGE CPP #-}
-{-# LANGUAGE Safe #-}
+
+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL <= 706 && defined(MIN_VERSION_comonad) && !(MIN_VERSION_comonad(3,0,3))
+{-# LANGUAGE Trustworthy #-}
+#endif
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Functor.Extend
diff --git a/src/Data/Functor/Plus.hs b/src/Data/Functor/Plus.hs
--- a/src/Data/Functor/Plus.hs
+++ b/src/Data/Functor/Plus.hs
@@ -1,5 +1,8 @@
 {-# LANGUAGE CPP #-}
-{-# LANGUAGE Safe #-}
+
+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL <= 706 && defined(MIN_VERSION_comonad) && !(MIN_VERSION_comonad(3,0,3))
+{-# LANGUAGE Trustworthy #-}
+#endif
 -----------------------------------------------------------------------------
 -- |
 -- Copyright   :  (C) 2011-2015 Edward Kmett
diff --git a/src/Data/Semigroup/Traversable/Class.hs b/src/Data/Semigroup/Traversable/Class.hs
--- a/src/Data/Semigroup/Traversable/Class.hs
+++ b/src/Data/Semigroup/Traversable/Class.hs
@@ -44,7 +44,9 @@
 import Data.Semigroup.Foldable
 import Data.Semigroup.Bifoldable
 import Data.Tagged
+#if __GLASGOW_HASKELL__ < 710
 import Data.Traversable
+#endif
 import Data.Traversable.Instances ()
 
 #ifdef MIN_VERSION_containers
diff --git a/src/Data/Semigroupoid.hs b/src/Data/Semigroupoid.hs
--- a/src/Data/Semigroupoid.hs
+++ b/src/Data/Semigroupoid.hs
@@ -1,8 +1,13 @@
 {-# LANGUAGE CPP #-}
+
 #if __GLASGOW_HASKELL__ >= 706
 {-# LANGUAGE PolyKinds #-}
 #endif
-{-# LANGUAGE Safe #-}
+
+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL <= 706 && defined(MIN_VERSION_comonad) && !(MIN_VERSION_comonad(3,0,3))
+{-# LANGUAGE Trustworthy #-}
+#endif
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Semigroupoid
diff --git a/src/Data/Semigroupoid/Static.hs b/src/Data/Semigroupoid/Static.hs
--- a/src/Data/Semigroupoid/Static.hs
+++ b/src/Data/Semigroupoid/Static.hs
@@ -1,11 +1,6 @@
 {-# LANGUAGE CPP #-}
-#ifdef MIN_VERSION_comonad
-#if __GLASGOW_HASKELL__ >= 707 && (MIN_VERSION_comonad(3,0,3))
-{-# LANGUAGE Safe #-}
-#else
-{-# LANGUAGE Trustworthy #-}
-#endif
-#else
+
+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL <= 706 && defined(MIN_VERSION_comonad) && !(MIN_VERSION_comonad(3,0,3))
 {-# LANGUAGE Trustworthy #-}
 #endif
 
diff --git a/test/doctests.hsc b/test/doctests.hsc
--- a/test/doctests.hsc
+++ b/test/doctests.hsc
@@ -16,7 +16,9 @@
 module Main where
 
 import Build_doctests (deps)
+#if __GLASGOW_HASKELL__ < 710
 import Control.Applicative
+#endif
 import Control.Monad
 import Data.List
 import System.Directory
