Closure parameter ordering bug fixed - essentially, we need to keep the localIndices
array because we can easily get into a situation where parameter 0 is stored in closure
1, and parameter 1 is in closure 0. Therefore we need to keep an array of which
indices are to be used to store which parameter. This is created as paramIndices.