Fixed JSON/BSON serialization of const/immutable structs/classes.