Add guards for PhantomJS.