Fixed memory usage in iter_prepare().