Misuse of substring in hex string compression.

Fixes #1.