#4954 Mongodb small changes

Fixing the two mentioned fixes from @wbylovesun 

Reference: https://github.com/zendframework/zf2/issues/4954