Fix #1423: No trailing zeros when calling getBytes
Merge pull request #1424 from gzm0/fix-get-bytes

Fix #1423: No trailing zeros when calling getBytes