Uhh...  Maybe it's time to add braces to the `if (sd->isNested())`.