Fixing problems when generating files: now accepting \n