Fixed index out of bounds in decode.

Bounds check was flipped.
Merge pull request #2 from markhibberd/master

Fixed index out of bounds in decode.