IO fixes

IO works properly with the GUI namely "new", "save" and "save as..."