Fixed issue where escape characters were written to filenames.