Fix adjust a byte count to the expected int len, and some trivial helper...

...s.

Except the bug fix, more trivial that's been accreting for #544 and #532.