Fixed overwriting of ports.