A possible fix for #46

This seems to fix the issue (and not break the tests https://travis-ci.org/mapio/flask-mongoengine).

Not sure it is the right way to go, though…