Minor nit: paramIndex could be scoped locally to the block in which it is used.  Doesn't bother me though.