getting tracebacks from bool2num called *within a template* requiring either boolean or string. Stop doing scope.function in templates and move it to the manifest where it belongs