Fixes issue that in some cases the doc_as_upsert option is ignored.
Closes #3265
Changes validation error message
Clean up update tests