Changed so invalid JSON messages are logged to System.err to simplify troubleshooting