Updated stats functions to use rb_check_arity