Do substitution.