fixed a few issues with $.couch.db not modifing correct db