Call to iterator next() was not throwing the right exception.