patch generator to tolerate missing commands in template file