added tests
cyclic refference protection + bug fix
Merge branch 'cyclic-reference-protect'