Fix bug in shared string replacement
Due to indirect substitution, now need to replace shared strings before doing array formulae expansion