Fixed up iterator and stack