Fix clear in couchdb state