Assorted fixes for bugs in the PagedBytesReference tests

Various fixes for the PBR tests, plus a typo where the wrong variable was used for a calculation.