generator: Fix handling of optional name, delete some debug outputs.