fixed an issue with self-loops in the generated main method which lead to validation errors