Added test case for cyclic references
Fixed circular references