Name anonymous classes to fix Marshaling, applies to #793