Fix several Haskell expressions to work with GHC 7.8.2

This is especially important with regard to the new default of dynamically linked libraries and executables.