small improvement to bson->json conversion