Change 'Tag.remove(Attribute)' to 'Attribute.remove()'.
Fixed: Tag's parent not set to null after being removed from parent.