Fixed memory leak
Fixed test
Fixed iterators