Implement piazza fix for iterator warnings