Fixed the ClassGenerator fully