Fixed substitution.

Creating @traiansf 's pull request, but rebased onto the correct history. I will review this myself since it's his code.