fixed KeyError problems with new version of mongodb

This pull request fixes issues with the currently plugins not working with new versions of mongodb