Update serial.cpp

Swaps TIV and TIV_next.