Fix substitutions not applied correctly.