Add CopyStream, fix bug in Pipe.