fix references to elements of a temporary array expression