Added circular reference support and respective tests