Mongo id fixes

Fixes a few issues involving mongodb

Closes #39 
Closes #43

Space added to "invalid dates "