Fix bugs in Kleene expansion

* #declaration.name is an atom, not #nonterminal
* Simplified dedupe_expansion/2