Allow reading version 1 ZGY files.
Fix two typos affecting reads from ZGY files in the very old version 1 format.
- Bulk data was returned scrambled because 8x8 sub-tiling was not decoded.
- Accessing histogram() caused a segfault.
Also add more robustness in one spot, not really needed after the typo fix but won't harm.