Fixes segfault with deep nesting of objects