Fix PORT_NUM substitution.