Fix various array checks