Fixed a couple of places where ti.next was still being used.
Also fixed a minor issue with an import.