Fix array variable handling

Needed to use array parameters with certain APIs.