Fix: iterator.Close() was not called in some cases, leaking resources