Ah, just noticed this mistake - should've been `isinstance(subclass, TopLevelDocumentMetaclass)`. Should I send a PR or will you fix in master @rozza?