data.php bug fixes