NPE during index iteration was fixed.