Fixed JSON support for RPC