Various GHC 7.8 compatibility fixes