Bug gh12

Fixes #12, and the general loop repeat bug.

Handle node counting in a structure outside the map_if composite.