Backport lang/ghc7 fixes from trunk.