Code to make sure that we never have a cycle in the graph of objects