Fix access to origData on update of 'set' types.
Merge remote branch 'origin/fix-array-origdata'
Fix flatten after merge.