Fix portIndex increment