Dave123 fixes when using mongodb

Hi,  I found a couple of issues when using ion_auth (which is awesome!) with Mongodb.