Fixes for CouchDB

It was impossible to log in using CouchDB as storage.