Handle pointer/reference to array in setVarId (#2645)