DocumentService::update() now generates valid document. Fixes "script or doc is missing" error upon updates.