Bug fix for attribute writing.