Fixed #566. PyMongo fix