Cherry-pick some changes over from type-specialized-attrs.
Merge branch 'master' into type-specialized-attrs