Bug fix for setting custom field values in API