Fix issues with .subst call