Issue #142: using iterator instead of size()