Added handling of isNested attribute.
Changed some debugging output that it is visible when fixed.