Fixed dumping of objects with circular references.

This closes #395 issue on Github.
2 files changed