Account for null byte in string length (resolves issue #833)

Resolves #833.