Set undefined as -1.