Fix wrong except IndexError -> StopIteration