Fix DCE for classes

Resolves #516