Fixes to make postMessage work in IE8