rpc: various RPC fixes for big-endian.