Fixed a few mongo repository scenarios