slight modifications to the template debug script