#4954 Mongodb small changes

Fixing the two mentioned fixes from @wbylovesun