Closed the I/O streams correctly.