Fix MongoDB and small bugfix