fix StopIteration and wayward null