Reorganize conditional to avoid shelling out if possible
Avoid shelling out in the DSL
valgrind: apply patch unconditionally