Tweaked class check - had the assumption that all classes must be instances of other ones which is not true in current mixin-driven class system.