simplify copying of attributes and keep_attrs tests