Fixed main method of generator.