@yf225: We should use an integer when building up enum options into a single "flags" field. I believe the problem may be that after `|=`-ing multiple flags together, we're left with a value that isn't actually defined in the original enum. I opened https://github.com/mongodb/mongo-c-driver/issues/36 on the C driver so that the public API can be changed to expect an int instead of the enum type.