Fixes for more recent versions of ghc