Fix iterator binding plus a few others, fix some infinite loops.