Fix wrong checks on subclassing of deprecated classes

closes #581