Fix bug where width is always zero
Change timing of initializing the iterator

Iterator being initialized at the declaration causes incorrect iterators with
no elements in it.