Changed default encoding of sum datatypes to ObjectWithType