bug fix in addInput and addOutput, ports where not always at same index