When simplifying ITE, distinguish between array terms and other terms.
Added a testcase that causes a FatalError without this patch.