Fix the array iteration for PhantomJS.