Fixed converting to json messages