Fixed index out of bounds in decode.

Bounds check was flipped, see diff.