Fixed substitution.

Creating pull request for @traiansf 's code, but rebased onto correct history. I will review this myself since it's his code.
can you please align this to the right with the others?