Fixed patch streams not being closed