Fixed few things in the template signature
Improved generation of process tree