Fix compilation errors on ghc < 7.8