Fixed issue #91 by only iterating on structures that haven't appeared further up in the loop.