Fixed generation bug