Fix wrt. name changes.
Add some preprocessor directives to handle when BSON is missing.