Ensure RPC serializes all types to primitives

Change-Id: I1b7dba92ce58843dbfc441426e3b6db08241a8ff