Fix the bson conversion