Speculatively removed inp and oup saving and close all ports