Bugfix: buffer overflow in output.cpp
Add a permission to output files
Debug output.cpp but err ramain.