Fix updating of function call stats