Mongo DB connection fix and minor logging fix