Layer iterator problem fix