Fixed some stuff in generator