added a test for unintended graph connection removal in add_trait during replace