Removed improper opening of output stream.