Improvements for CBLDocument handling.