Fixed closing streams.