Added tests which cover circular references and nulls