Minor modifications for making BSON transfer correct.