Versioned updated to treat fields as lone array

Mental blindspots fixed:
 array_diff_key -> array_intersect_key
and
 $fields['db'] -> $fields