Some Bug fixes and improve outports parsing