ClassTransformer: fixed something that went wrong when I rebased remodel
Reapply the fix for #1204 after it got lost inthe remodel merge