So the env. var. sub. syntax is the same as the var. sub. syntax, which meant that all expressions of the form `${foo}` were being replaced with `undefined`. Fixed this. Should not have used same syntax. Oh well.