Fix infinite recursion if objects reference each other