Fix issue where __debugInfo() would be called with 0 depth.

When the remaining depth is 0, no properties should be extracted and
exported.