Fixed some issues with RPC.