Fixed stage generation bug