Coerce all array values to strings before comparison in val(). Fixes bug #7123.