Bug in iterative version.