For ENG-5865, track PBD size more accurately and fix error handling and tests