Fix 'undefined index' error, when entering scope recursively