Fixes to mysql.php