Fix hyphenated ID decoding

This pull request adds tests for `DecodeString()` and fixes hyphenated ID decoding to avoid an index out-of-bounds panic.

@jrconlin r?