FIX PHP Warnings

if (is_array($values)) added to fix warnings.