fixing RPC bugs.