Bug fixing for files generated over stdio