fixing output file writing for human-readable exporter