Fix TypeError: super(type, obj): obj must be an instance or subtype of type #3610