Fix array stack allocation for slicing code