Bug fixes for the Statistics.php file