Fix weird intermittent failure in PhantomJS