Fix don't check falsy on indexes.

If the prev index was 0 this could incorrectly give the first 2 coords instead of checking dot product.