Fixes for building on GHC 7.0.4