Fixed problem with array ops at the ends of arrays