Some fixes for mysql.