Fixed handling of getting and setting attributes.