One case that doesn't work with recursive calls.
fixed possible missing 'child' key.