Fix ${extract expansion for use within ${if inlist etc. Bug 1524