fix crash on empty stats in c backend