Fix some compiler warnings and (Mongo Driver) deprecations