Mongo related fixes