When pruning cells, now checks for circular references