Cherry picked new_attributes branch.