toString() for entities, a couple of fixes for Haskell parser