Demonstating a bug in bson code