Fixed the parser to work with polymorphic types.