Upgraded to new bdlib and fixes