Partial evaluation improvements

Better names for generated definitions, and transformation rule fix.