(Minor) Can removal of this.v be moved to between ExpandScalar() and the big if (strstr) above ?
It'd save duplication between here and the failing block.