Fix DeriveAnyClass (Trac #9968)