fixes to mongowrapper per avital's very helpful suggestions