Render byte[] properly in the cli

We recently noticed that the cli doesn't render byte[] properly (reported in #1663). This patch fixes that.
The logic would be a bit simpler if you start at `0` and always increment. Then the `else` is not needed.