Improve production and expression name handling.

Signed-off-by: Etienne M. Gagnon <egagnon@j-meg.com>