Fix to get all polymorphic types. Add spec tests