Fixed some issues and now BSON unit tests are passing again.