Fixing some bugs and bringing back functionality not previously
implemented for the CouchDB backend