Fixing bson binary TypeOf exception after fixing issue 1612