Reference types can have circular pointers to each other, thus we need to control recursion.
Closes #500