Compile fixes for contemporary ghc