Fix Instance Iterator

With the help of Josh we fixed the instance iterator and stopped massive
memory leaks from the collision systems and elsewhere.