Bug fix of output filenames of the writer