Fix static function call
Fix variable reference error in stats