Added edge case for next pointers.