Couchdb sync issues

Fixed issues with pulling from CouchDB.
There are still some issues pushing.  Will follow-up with email.