Fix output generation