Fix output stream