Fixed a bug with clearing attributes.