Fixed issues with PhantomJS.