Misc haskell improvements