Handle circular references in prettify