Added protection against self variable subsitution