Apply fix for #1003 to validateAttribute.