Fix hasNext handling in DelayedTaskIterator + enforce tests