helper/schema: improve InternalValidate for sets