Corrected the pointer to the next node's type