Updated PatentRegularizer to use stream.