Index is working, memory leaks fixed.