Fix bug in mongo.js