minor cleanings and return the length of the value, and not the amount of copied bytes
support for check and stats commands in the pure-perl client