Added support for setting attributes with an object