fix array casting in InCriterion and InModelCriterion. Fix #492