publish_port and some corrections