Handle io errors.
Implement `-b`/`--bytes`.
Refactor code a bit.