[Couchbase] Pulling changes from unsafe_protocol branch.