bson fixes for MongoCode

closes #5