Fix a couple of decoding bugs