use just an integer for tracking func_depth. span_fatal -> span_err