fixed bug with subfuncs always being passed to any function with a second param; templates