generator.py: Exception: NotImplemented -> BadType + few unittests