Fix output redirect to file