Fixed a problem in handling attr errors.