a couple of fixes for entities serialization and Haskell parser