Fix spurious test failures in PhantomJS.