Fixes issue #74

https://github.com/couchbase/couchbase-lite-java-core/issues/74
Fix issue #194

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