Do some optimizations in array.c