Issue #212 - Fix by porting changes over from iOS codebase.

https://github.com/couchbase/couchbase-lite-android/issues/212