Handle port_index as number