Better fix for attribute errors.