Hacks to enable IE8 support

Not fully tested, but should work.