CORE: crash fix for iterating over instances