Added changes to work fine with newest ghc