Improves some tests to make the test suite compatible with PhantomJS and IE8