Remove unnecessary code from empty substitutions