Finish bug fix for iterator