Fix #1423: No trailing zeros when calling getBytes