Merged several projects

+ Self looped edges fix
+ Added template handling in WF example