Fixed a bug adding a NamedObject without a name.