Changed setAttributes() method.