Fixed crashes when function did not return variable
Now returns a template value setup when the function is defined.