Fix automatic generation conditions