Fixed viewercount.php logic for edge cases