Fix bug in decoding json messages.