Fix "variable 'Type' shadowed in 'fun'" warning.

Rewrite a block that was causing a "variable 'Type' shadowed in 'fun'"
warning when compiling with warnings turned on.  This is odd code anyway --
the fun(Type) ... end(Type) looks redundant to me.
Use unique names for locally bound variables.

When generating new locally bound variables, use a unique name instead of
'L'.  This fixes a "variable 'L' shadowed in generate" warning when compiling
client code.

The unique name is generated using erlang:now(), which is guaranteed to be
different every time it is called.
Merge branch 'fix-shadowed-type'