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.