Handle example objects with nested inner classes.

Before this change they generated an infinite loop.