Attempts to fix bugs in IE8/9