Fix FIRM generation for arrays

It's amazing how small this diff is given how much pain arrays have given me, but these *should* work now in all cases.

Fixes #167
The name of this variable is a bit misleading now. How about `resultType`?