Equals and compare weren't being evaluated properly for optional attributes.