[DF-625] Fixes in stats to support multiple top level functions