Fix MB-12073 and MB-12071. Bugs in array functions.