Some fixes for SerializeIListOfPrimitives