rpc: be a bit more defensive.