Improve variable substitution.