Updated CouchDB scripts