Fix building gen bug