fixed bugs with missing typedef port_t