Update rpc test code for compatibility