Fix JSON message encoding in output message

Here is a little fix for issue #30.