Fixed a bunch of warnings reported by ghc