Fix issues with the mongo adapter.