Handle custom attributes with empty values, fixes #270