Use python 3 compatible iteration.