Minor bug in iteration