MB-8745: 05b32a01118bfa09f5d2e4a3e0b69b0114fbde48
MB-7250: acec618cfabca97efb6b27be8833bf122f02de12

Change-Id: Ifee5ad9c6ad1c71b27a2fef6d9c634213aa9fffe
Reviewed-on: http://review.couchbase.org/28782
Reviewed-by: Philip Labee <philip@couchbase.com>
Tested-by: Philip Labee <philip@couchbase.com>