diff --git a/src/stream.js b/src/stream.js
index 3d028df4..c6177768 100644
--- a/src/stream.js
+++ b/src/stream.js
@@ -1,8 +1,8 @@
 import util from './util';
 
-// if (typeof TransformStream === 'undefined') {
-  Object.assign(typeof window !== 'undefined' ? window : global, require('@mattiasbuelens/web-streams-polyfill'));
-// }
+if (typeof TransformStream === 'undefined') {
+  require('@mattiasbuelens/web-streams-polyfill');
+}
 
 const nodeStream = util.getNodeStream();
 
@@ -130,6 +130,7 @@ function transformPair(input, fn) {
   const outgoing = transformWithCancel(async function() {
     incomingTransformController.error(new Error('Readable side was canceled.'));
     await pipeDonePromise;
+    await new Promise(setTimeout);
   });
   fn(incoming.readable, outgoing.writable);
   return outgoing.readable;
diff --git a/test/unittests.js b/test/unittests.js
index b2d10619..9359c60b 100644
--- a/test/unittests.js
+++ b/test/unittests.js
@@ -5,9 +5,9 @@ if (typeof Symbol === 'undefined') {
 if (typeof Promise === 'undefined') {
   require('core-js/fn/promise');
 }
-// if (typeof TransformStream === 'undefined') {
-  Object.assign(typeof window !== 'undefined' ? window : global, require('@mattiasbuelens/web-streams-polyfill'));
-// }
+if (typeof TransformStream === 'undefined') {
+  require('@mattiasbuelens/web-streams-polyfill');
+}
 
 (typeof window !== 'undefined' ? window : global).resolves = function(val) {
   return new Promise(function(res) { res(val); });