fix minor bugs in stats.php