fixed a few things before adding couch functions.