Guard against missing elements in array patterns when checking function parameters.

This previously caused an exception.