Added support for some variable substitutions