Fix non-pythonic iterations