Fix hopefully finally the modified output write/read